Unwrap the FROM_UTF8 macro in favor of direct function

The extern just gets annoying to try to export the func later. We also yeet TO_UTF8 to string_utils.h for parity.
This commit is contained in:
Marek Roszko
2023-09-09 00:10:57 -04:00
parent bd3aca2887
commit 11de95778b
90 changed files with 266 additions and 248 deletions
+11
View File
@@ -364,6 +364,17 @@ std::string UIDouble2Str( double aValue );
*/
std::string FormatDouble2Str( double aValue );
/**
* Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
*
* wxstring is a wxString, not a wxT() or _(). The scope of the return value
* is very limited and volatile, but can be used with printf() style functions well.
*
* @note Trying to convert it to a function is tricky because of the type of the
* parameter!
*/
#define TO_UTF8( wxstring ) ( (const char*) ( wxstring ).utf8_str() )
/**
* Convert an expected UTF8 encoded std::string to a wxString.
* If fails, tray to convert using current locale