-
Committer:
Eduard Braun
-
Date:
2017-01-17 22:06:15 UTC
-
Revision ID:
eduard.braun2@gmx.de-20170117220615-nymswqqru4ikwuaa
Partially fix opening of librevenge based input formats (cdr/vsd/wpg) on Windows if the filename contains non-ASCII characters
The problem is that "RVNGFileStream" uses "fopen()" internally which only supports ANSI filenames on Windows (i.e. a complete fix would require upstream code changes).
By using "g_win32_locale_filename_from_utf8()" the problem can be worked around in most cases, though:
* the filename is converted to the current codepage (i.e. all 255 characters that are available in the current character encoding are allowed in the filename)
* even if the filename contains a character that's not available in the current character encoding it's attempted to use the alternative short (8.3) file name instead
Therefore the input operation will only fail in the unlikely case that the filename contains a character not available in the current ANSI code page while at the same time short file names are disabled on the file system (which is not the case in standard configurations).