Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-02-10 15:29:26 +0300
committerCorinna Vinschen <corinna@vinschen.de>2010-02-10 15:29:26 +0300
commit4f1c922e065335c4bd186f9b9d504e33a2568406 (patch)
tree947dca3d99a587e6c6a3b5b625fb9df93c53373c
parentae40237a0a3fd8b4c001065c5f7ae5b749d9a3fa (diff)
* nlsfuncs.cc (__set_charset_from_locale): Allow "@euro" modifier only
for locales which use EUR as currency.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/nlsfuncs.cc5
2 files changed, 9 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index dbede5c0d..3221fd1e2 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2010-02-10 Corinna Vinschen <corinna@vinschen.de>
+ * nlsfuncs.cc (__set_charset_from_locale): Allow "@euro" modifier only
+ for locales which use EUR as currency.
+
+2010-02-10 Corinna Vinschen <corinna@vinschen.de>
+
* nlsfuncs.cc (__get_lcid_from_locale): Convert iu_CA to iu-Latn-CA
rather than iu-Cans-CA on Vista and later.
(__set_charset_from_locale): Set default charset for iu_CA to UTF-8.
diff --git a/winsup/cygwin/nlsfuncs.cc b/winsup/cygwin/nlsfuncs.cc
index c351c9de1..5fa767b84 100644
--- a/winsup/cygwin/nlsfuncs.cc
+++ b/winsup/cygwin/nlsfuncs.cc
@@ -879,6 +879,7 @@ __set_charset_from_locale (const char *locale, char *charset)
{
UINT cp;
LCID lcid = __get_lcid_from_locale (locale);
+ wchar_t wbuf[9];
/* "C" locale, or invalid locale? */
if (lcid == 0 || lcid == (LCID) -1)
@@ -967,7 +968,9 @@ __set_charset_from_locale (const char *locale, char *charset)
else if (lcid == 0x042e) /* hsb_DE (Upper Sorbian/Germany) */
cs = "ISO-8859-2";
else if (lcid == 0x0491 /* gd_GB (Scots Gaelic/Great Britain) */
- || has_modifier ("@euro"))
+ || (has_modifier ("@euro")
+ && GetLocaleInfoW (lcid, LOCALE_SINTLSYMBOL, wbuf, 9)
+ && !wcsncmp (wbuf, L"EUR", 3)))
cs = "ISO-8859-15";
else
cs = "ISO-8859-1";