From 4747078502ec9a9aaa7e867ef7b29acd194c2b8d Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 25 Mar 2009 09:02:22 +0000 Subject: [PATCH] * 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". --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/strfuncs.cc | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 09ff8868f..0464a0a81 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2009-03-25 Corinna Vinschen + + * 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 * strfuncs.cc (__kr_wctomb): Use codepage 50949 rather than 949. diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc index f6dc8f01f..adadc32b7 100644 --- a/winsup/cygwin/strfuncs.cc +++ b/winsup/cygwin/strfuncs.cc @@ -28,7 +28,7 @@ details. */ implementation of the base functions for the conversion using 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 __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, mbstate_t *state) { - return __db_wctomb (r,s, wchar, 50949); + return __db_wctomb (r,s, wchar, 51949); } extern "C" int @@ -190,7 +190,7 @@ extern "C" int __kr_mbtowc (struct _reent *r, wchar_t *pwc, const char *s, size_t n, 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 @@ -253,10 +253,10 @@ __set_charset_from_codepage (UINT cp, char *charset) strcpy (charset, "SJIS"); return __sjis_mbtowc; case 936: - strcpy (charset, "GBK"); + strcpy (charset, "GB2312"); return __gbk_mbtowc; case 949: - case 50949: + case 51949: strcpy (charset, "EUCKR"); return __kr_mbtowc; case 950: