lilypond-auto
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lilypond-auto] [LilyIssues-auto] [testlilyissues:issues] #5833 Fix MinG


From: Auto mailings of changes to Lily Issues via Testlilyissues-auto
Subject: [Lilypond-auto] [LilyIssues-auto] [testlilyissues:issues] #5833 Fix MinGW UTF-8 locale settings
Date: Tue, 10 Mar 2020 10:55:49 -0000

Diff:

--- old
+++ new
@@ -1,10 +1,32 @@
-Fix MinGW UTF-8 locale settings
+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.

-This commit fixes LilyPond's MinGW UTF-8 locale settings.
-It eliminates the garbled characters.
+`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.

 http://codereview.appspot.com/551580045

[issues:#5833] Fix MinGW UTF-8 locale settings

Status: Started
Created: Sat Mar 07, 2020 04:22 PM UTC by Masamichi Hosoda
Last Updated: Tue Mar 10, 2020 10:50 AM UTC
Owner: Masamichi Hosoda

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.

http://codereview.appspot.com/551580045


Sent from sourceforge.net because address@hidden is subscribed to https://sourceforge.net/p/testlilyissues/issues/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/testlilyissues/admin/issues/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.

_______________________________________________
Testlilyissues-auto mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/testlilyissues-auto

reply via email to

[Prev in Thread] Current Thread [Next in Thread]