Issue 5833/3: Doc: Add handling Unicode filenames on Windows to changes
Issue 5833/2: Add workaround for MinGW UTF-8 stat issue
When UTF-8 process locale is active,
LilyPond could not find some Unicode filenames.
stat ()
in msvcrt.dll returns -1
(i.e. error) with some UTF-8
filenames even if process code page is UTF-8 and the file exists.
So we get the process code page with GetACP ()
and, if it is UTF-8,
convert the filename to wide strings and use _wstat ()
.
If Universal CRT (UCRT, newer than msvcrt.dll) is used
(i.e. _UCRT
is defined), no such workaround is needed.
Issue 5833/1: Add workaround for MinGW UTF-8 locale settings issue
Issue 2173 and 5828 activates UTF-8 process locale on Windows.
They allow LilyPond for Windows to use Unicode filenames.
However, when LilyPond outputs Unicode strings to tty, it garbled.
setlocale (LC_ALL, "")
in msvcrt.dll sets user-defined ANSI code page
(i.e. 437 for English, 932 for Japanse, etc.)
even if process code page is UTF-8 (i.e. 65001 for all languages).
With this setting, outputting UTF-8 string becomes garbled.
So we get the process code page with GetACP ()
and,
if it is UTF-8, explicitly set locale's code page to UTF-8 (i.e. 65001).
If Universal CRT (UCRT, newer than msvcrt.dll) is used
(i.e. `_UCRT' is defined), no such workaround is needed.
Diff:
passes make, makecheck and a full make doc
Patch on coumntdown for March 11th.
Diff:
Passes make, make check and a full make doc
Patch on countdown for March 15th
Patch counted down - please push.
I've pushed to staging.
commit f38a526a97ec3659dd450d9f4fbc15caa30216ec
Issue 5833/3: Doc: Add handling Unicode filenames on Windows to changes
commit c453b26d6eae33a537aeabd68501c00a6bf3bf5f
Issue 5833/2: Add workaround for MinGW UTF-8 stat issue
commit 6b34654ae7f93b9228e860c130754f83a6c35d21
Issue 5833/1: Add workaround for MinGW UTF-8 locale settings issue