diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2023-03-26 14:06:38 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2023-03-26 14:06:38 +0300 |
commit | 2d5492453a4aef0b761800cd89fd41b11af6c2d3 (patch) | |
tree | ec6266f2f3bc8baee9b4f45719f596ec7b810ac4 /winsup/cygwin/nlsfuncs.cc | |
parent | c3e7f7609e46383ee7952f6ab3345abfb535d7a4 (diff) |
Cygwin: locales: fix behaviour for @euro locales
Latest Windows supports more EU locales than GLibc, so some of the
@euro locales are not covered by checking the GLibc locale defaults.
Those locales have no long history, they are all UTF-8. So just
check for @euro in the UTF-8 case and set them to ISO-8859-15.
Fixes: 2483e54be852e ("Cygwin: locale: Set default charset from Linux locale -> codeset mapping")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/nlsfuncs.cc')
-rw-r--r-- | winsup/cygwin/nlsfuncs.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/winsup/cygwin/nlsfuncs.cc b/winsup/cygwin/nlsfuncs.cc index 6821a43c3..b097a6e5f 100644 --- a/winsup/cygwin/nlsfuncs.cc +++ b/winsup/cygwin/nlsfuncs.cc @@ -1610,9 +1610,17 @@ __set_charset_from_locale (const char *loc, char *charset) cs = "ISO-8859-13"; break; case 1258: - default: cs = "UTF-8"; break; + default: + /* Some (pretty new) EU locales don't exist in GLibc and haven't been + catched above. Check for @euro modifier again and make these locales + always use ISO-8859-15. */ + if (modifier && !strcmp (modifier + 1, "euro")) + cs = "ISO-8859-15"; + else + cs = "UTF-8"; + break; } stpcpy (charset, cs); } |