Hello ardi,
Wednesday, July 4, 2012, 8:56:45 PM, you wrote:
a> So, is there someway of converting this string to an utf8 encoding which
a> will work with fopen() on MSW?
a> I'm asking this because I'm using a third-party library that opens files
a> expecting a char* filename (otherwise, if I could pass a FILE* pointer, I
a> could use the wxFileName approach, which works fine for me).
Windows doesn't use UTF-8, ever.
wxString::fn_str() is probably what you're looking for:
http://docs.wxwidgets.org/stable/wx_wxstring.html#wxstringfnstr
However, if the library you're using only supports "char *", it just
won't be able to load files that can be represented in the current
locale encoding.
E.g if you're on a German system, you'll never be able to load a file
with Japanese chars in the filename if you're stuck with an 8 bit encoding.
HTH
Eric