* nlsfuncs.cc (__set_charset_from_locale): Allow "@euro" modifier only

for locales which use EUR as currency.
This commit is contained in:
Corinna Vinschen 2010-02-10 12:29:26 +00:00
parent ae40237a0a
commit 4f1c922e06
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
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

View File

@ -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";