Character encoding issues with file dialog API and Windows
Under modern Windows systems, the current File Dialog API has a faulty desing:
Because directories are passed as arguments of type char*
, it is bound to fail when Unicode characters are present. Linux and Mac OS X systems mostly have little trouble.
This is noted here, however I still am not certain how to overcome this issue. Should the whole API ditch char
and use w_char
? Something else? Currently, because of this the library fails to compile. Shortly, a fix will be pushed, which disables Unicode support for Windows, until a better solution is proposed.
Comments (2)
-
reporter -
reporter - changed status to resolved
Update: Two version of the file dialog API exist now, SDLU_FileDialog() and SDLU_FileDialogW(). Under Windows systems, they will use the appropriate ANSI or UNICODE Win32 functions. It is the user of the API who should decide whether he wants to use
char
orwchar_t
. Both options work in exactly the same way. - Log in to comment
This is the commit that just uses the ANSI functions. Again, it is a temporary solution (the good-old duct tape method) for a much larger issue, which is still to be resolved https://bitbucket.org/sdlu/sdlu/commits/624d1287e1bd3262a1ee23db4bee7b78095f67be