I’m conducting some internal testing with a project of mine, and when testing the application on non-dev machines I ran into a few issues. Specifically when running the software on a Polish copy of Windows. The issue was fairly easy to track down, it was basically some of the std::string’s being passed to the ci::TextBox
resulting in a utf8::invalid_utf8
exception being thrown.
Last time I bothered looking into text encoding I found it to be a pretty big hairy mess. My recent searches didn’t really lead me to any new conclusions. Some people seemed to be advocating using UTF8 throughout and unless I’m compelled otherwise, that’s what I’m sticking to. The two things that triggered these invalid UTF8 characters were as follows:
-
BASS (the audio library) - per default it seems - returns ANSI text (for audio device names). A simple config setting causes it to return UTF8 encoded instead.
-
Path string returned via boost isn’t UTF8 either by default. I found this little helpful page that provided some code to have them default to UTF8 as well:
http://www.boost.org/doc/libs/1_51_0/libs/locale/doc/html/default_encoding_under_windows.html
Hopefully that helps someone else.
But I do also have a question re. all of this malarkey. The BASS help file states that the UTF8 encoding only works on the windows-based version of the library. Some point in the future I’d like to also port the software to run on mac’s, which makes me a but worried about if UTF8 across the board works well here too.
So basically my question to y’all is, if anyone has any good practical advice and if anyone knows of any good support for cross-platformy text.
Gazoo