Use iconv to convert filenames from UTF-8.

Patch by miniupnp, with some C89 adjustments.
Enabled for Haiku and the generic Linux/*BSD part of the Makefile.
Please adjust as needed.

Fixes #10 for codepages for which we have a font.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2172 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues
2016-12-02 19:43:23 +00:00
parent 0ce386bb19
commit 0eaf3fce96
6 changed files with 117 additions and 13 deletions

View File

@@ -469,6 +469,13 @@ int Init_program(int argc,char * argv[])
getcwd(Main_selector.Directory,MAX_PATH_CHARACTERS);
#endif
#ifdef ENABLE_FILENAMES_ICONV
// Initialisation de iconv
// utilisé pour convertir les noms de fichiers
cd = iconv_open(TOCODE, FROMCODE); // From UTF8 to ANSI
cd_inv = iconv_open(FROMCODE, TOCODE); // From ANSI to UTF8
#endif /* ENABLE_FILENAMES_ICONV */
// On en profite pour le mémoriser dans le répertoire principal:
strcpy(Initial_directory,Main_selector.Directory);