* libc/locale/nl_langinfo.c (nl_langinfo): Return "CP932" when using
SJIS on Cygwin. Explain why.
This commit is contained in:
parent
96697c23e4
commit
88116ad22e
|
@ -1,3 +1,8 @@
|
||||||
|
2010-01-24 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* libc/locale/nl_langinfo.c (nl_langinfo): Return "CP932" when using
|
||||||
|
SJIS on Cygwin. Explain why.
|
||||||
|
|
||||||
2010-01-23 Corinna Vinschen <corinna@vinschen.de>
|
2010-01-23 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* libc/locale/locale.c (loadlocale): Allow CP932 as alias for SJIS.
|
* libc/locale/locale.c (loadlocale): Allow CP932 as alias for SJIS.
|
||||||
|
|
|
@ -79,6 +79,20 @@ _DEFUN(nl_langinfo, (item),
|
||||||
else if (strcmp (ret + 2, "21866") == 0)
|
else if (strcmp (ret + 2, "21866") == 0)
|
||||||
ret = "KOI8-U";
|
ret = "KOI8-U";
|
||||||
}
|
}
|
||||||
|
else if (ret[0] == 'S'/*JIS*/)
|
||||||
|
{
|
||||||
|
/* Cygwin uses MSFT's implementation of SJIS, which differs
|
||||||
|
in some codepoints from the real thing, especially
|
||||||
|
0x5c: yen sign instead of backslash,
|
||||||
|
0x7e: overline instead of tilde.
|
||||||
|
We can't use the real SJIS since otherwise Win32
|
||||||
|
pathnames would become invalid. OTOH, if we return
|
||||||
|
"SJIS" here, then libiconv will do mb<->wc conversion
|
||||||
|
differently to our internal functions. Therefore we
|
||||||
|
return what we really implement, CP932. This is handled
|
||||||
|
fine by libiconv. */
|
||||||
|
ret = "CP932";
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
ret = "";
|
ret = "";
|
||||||
if ((s = setlocale(LC_CTYPE, NULL)) != NULL) {
|
if ((s = setlocale(LC_CTYPE, NULL)) != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue