Emanuele Aina wrote:
You should use the g_filename_to_utf8() and g_filename_from_utf8() utility function to convert enconding between the internal rapresentation (UTF8) and the filesystem rapresentation (usually locale dependent).
But on Windows there's an additionall complication.
The 'filename' encoding glib gives us is mainly only useful for names in the 8-bit CP_ACP encoding. Anything else (including UTF-8 if glib uses that for 'filename' on XP) will fail when passed to any standard io calls. In these cases one would need to convert to UTF-16 and then call a different file routine. And in order to get a single binary that works both on Windows 95/98/ME and on Windows NT/2K/XP that needs to be checked at runtime.
Oh, and another slight problem is that often it's hard to get systems setup where the three glib encodings are different and to feed them proper test cases, so not all the routines do all the right things. They're working on it, but there are some issues still.