Cygwin: locales: fix behaviour for @cjk* and @euro locales
@cjknarrow and @cjkwide modifiers are newlib only, so they need
some tweaking in __set_charset_from_locale.
Fixes: 2483e54be8
("Cygwin: locale: Set default charset from Linux locale -> codeset mapping")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
68aea16d3f
commit
c3e7f7609e
|
@ -1528,7 +1528,7 @@ __set_charset_from_locale (const char *loc, char *charset)
|
||||||
{
|
{
|
||||||
wchar_t win_locale[ENCODING_LEN + 1];
|
wchar_t win_locale[ENCODING_LEN + 1];
|
||||||
char locale[ENCODING_LEN + 1];
|
char locale[ENCODING_LEN + 1];
|
||||||
const char *modifier;
|
char *modifier;
|
||||||
char *c;
|
char *c;
|
||||||
UINT cp;
|
UINT cp;
|
||||||
|
|
||||||
|
@ -1537,6 +1537,12 @@ __set_charset_from_locale (const char *loc, char *charset)
|
||||||
modifier = strchr (loc, '@');
|
modifier = strchr (loc, '@');
|
||||||
if ((c = strchr (locale, '.')))
|
if ((c = strchr (locale, '.')))
|
||||||
stpcpy (c, modifier ?: "");
|
stpcpy (c, modifier ?: "");
|
||||||
|
/* Cut out @cjknarrow/@cjkwide modifier, both are newlib specials and
|
||||||
|
don't affect the codeset. */
|
||||||
|
modifier = strchr (locale, '@');
|
||||||
|
if (modifier && (!strcmp (modifier + 1, "cjknarrow")
|
||||||
|
|| !strcmp (modifier + 1, "cjkwide")))
|
||||||
|
*modifier = '\0';
|
||||||
|
|
||||||
default_codeset_t srch_dc = { locale, NULL };
|
default_codeset_t srch_dc = { locale, NULL };
|
||||||
default_codeset_t *dc = (default_codeset_t *)
|
default_codeset_t *dc = (default_codeset_t *)
|
||||||
|
|
Loading…
Reference in New Issue