string_utils: Add From_UTF8( const char* cstring ) and From_UTF8( const std::string aString ),

mainly because we now use std::string in a lot of function using previously char*
FROM_UTF8(const char* cstring) now calls From_UTF8(const char* cstring)
This commit is contained in:
jean-pierre charras
2023-07-16 08:21:43 +02:00
parent 89780d353a
commit 0ecf5033e2
3 changed files with 50 additions and 10 deletions
+8
View File
@@ -366,4 +366,12 @@ std::string UIDouble2Str( double aValue );
*/
std::string FormatDouble2Str( double aValue );
/**
* Convert an expected UTF8 encoded std::string to a wxString.
* If fails, tray to convert using current locale
* If still fails, return the initial string (can be already a converted string)
*/
wxString From_UTF8( const std::string& aString );
wxString From_UTF8( const char* cstring );
#endif // STRING_UTILS_H