diff options
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/strfuncs.cc | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 08e891394..cb7341295 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2009-09-23 Corinna Vinschen <corinna@vinschen.de> + * strfuncs.cc (__set_charset_from_codepage): Fetch current ANSI + codepage if cp is 0. + +2009-09-23 Corinna Vinschen <corinna@vinschen.de> + * strfuncs.cc (sys_cp_wcstombs): Convert lone surrogate pair second halves to unambiguous ASCII SO sequence. When converting chars invalid in current codepage to ASCII SO sequence, make diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc index d4dbdaf55..e273f76c6 100644 --- a/winsup/cygwin/strfuncs.cc +++ b/winsup/cygwin/strfuncs.cc @@ -307,7 +307,7 @@ __big5_mbtowc (struct _reent *r, wchar_t *pwc, const char *s, size_t n, } /* Convert Windows codepage to a setlocale compatible character set code. - Called from newlib's setlocale() with the current ANSI codepage, if the + Called from newlib's setlocale() with codepage set to 0, if the charset isn't given explicitely in the POSIX compatible locale specifier. The function also returns a pointer to the corresponding _mbtowc_r function. Also called from fhandler_console::write_normal() if the @@ -315,6 +315,8 @@ __big5_mbtowc (struct _reent *r, wchar_t *pwc, const char *s, size_t n, extern "C" mbtowc_p __set_charset_from_codepage (UINT cp, char *charset) { + if (cp == 0) + cp = GetACP (); switch (cp) { case 437: |