* strfuncs.cc (__kr_wctomb): Use codepage 51949 rather than 50949.

(__kr_mbtowc): Ditto.
	(__set_charset_from_codepage): Ditto.  Translate codepage 936 to
	"GB2312" and drop the charset name "GBK".
This commit is contained in:
Corinna Vinschen 2009-03-25 09:02:22 +00:00
parent 790d0a4c64
commit 4747078502
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2009-03-25 Corinna Vinschen <corinna@vinschen.de>
* strfuncs.cc (__kr_wctomb): Use codepage 51949 rather than 50949.
(__kr_mbtowc): Ditto.
(__set_charset_from_codepage): Ditto. Translate codepage 936 to
"GB2312" and drop the charset name "GBK".
2009-03-24 Corinna Vinschen <corinna@vinschen.de> 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
* strfuncs.cc (__kr_wctomb): Use codepage 50949 rather than 949. * strfuncs.cc (__kr_wctomb): Use codepage 50949 rather than 949.

View File

@ -28,7 +28,7 @@ details. */
implementation of the base functions for the conversion using implementation of the base functions for the conversion using
the MulitByteToWideChar/WideCharToMultiByte functions. */ the MulitByteToWideChar/WideCharToMultiByte functions. */
/* GBK, eucKR, and Big5 conversions are not available so far in newlib. */ /* GB2312, eucKR, and Big5 conversions are not available so far in newlib. */
static int static int
__db_wctomb (struct _reent *r, char *s, wchar_t wchar, UINT cp) __db_wctomb (struct _reent *r, char *s, wchar_t wchar, UINT cp)
@ -84,7 +84,7 @@ extern "C" int
__kr_wctomb (struct _reent *r, char *s, wchar_t wchar, const char *charset, __kr_wctomb (struct _reent *r, char *s, wchar_t wchar, const char *charset,
mbstate_t *state) mbstate_t *state)
{ {
return __db_wctomb (r,s, wchar, 50949); return __db_wctomb (r,s, wchar, 51949);
} }
extern "C" int extern "C" int
@ -190,7 +190,7 @@ extern "C" int
__kr_mbtowc (struct _reent *r, wchar_t *pwc, const char *s, size_t n, __kr_mbtowc (struct _reent *r, wchar_t *pwc, const char *s, size_t n,
const char *charset, mbstate_t *state) const char *charset, mbstate_t *state)
{ {
return __db_mbtowc (r, pwc, s, n, 50949, state); return __db_mbtowc (r, pwc, s, n, 51949, state);
} }
extern "C" int extern "C" int
@ -253,10 +253,10 @@ __set_charset_from_codepage (UINT cp, char *charset)
strcpy (charset, "SJIS"); strcpy (charset, "SJIS");
return __sjis_mbtowc; return __sjis_mbtowc;
case 936: case 936:
strcpy (charset, "GBK"); strcpy (charset, "GB2312");
return __gbk_mbtowc; return __gbk_mbtowc;
case 949: case 949:
case 50949: case 51949:
strcpy (charset, "EUCKR"); strcpy (charset, "EUCKR");
return __kr_mbtowc; return __kr_mbtowc;
case 950: case 950: