The suggestion that you gave didn't work, I receive an empty string, so it probably isn't utf8
However, after more searching I found a very handy website on which I could try out several conversions:
http://string-functions.com/encodedecode.aspx
After trying out some encodings I got the correct result using:
input: iso-8859-1
output: gb2312
To get the correct output I use the following code:
Code: Select all
wxString str("ÀðÓãÔ¾ÁúÃÅ3.bmp", wxCSConv(wxT("gb2312")));
However, I need it the other way around and that doesn't seem to work.
In the data file I have the file names in Chinese. This name needs to be encoded to iso-8859-1, to do this I use the following code;
Code: Select all
wxString iso(layer.props.at("FileName").utf8_str(), wxCSConv(wxT("iso-8859-1")) );
wxLogDebug(iso);
However the result of this conversion is (which seems to be utf8):
鲤鱼è·é¾é¨3.bmp
and it should be:
ÀðÓãÔ¾ÁúÃÅ3.bmp
When I do this conversion on the website that I mentioned it works fine, how should I do this in wxWidgets?