UTF8 conversion wxString :: ToStdString ()
I am writing an application and I am using wxWidgets as the GUI. The main body of the application uses std::string
UTF8 as its encoding. I need a normal way to convert between wxString
and std::string
. I know about wxString::ToUTF8()
, but somewhat awkward to use (and inefficient I think since it returns some proxy object). There is a better method wxString::ToStdString()
, but if I understood correctly, it uses the current encoding of the locale. Is there a way to configure wxWidgets globally such that it uses UTF8 encoding when converting between wxString
and narrow char ( const char*
, std::string
)?
source to share