Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-01-17 12:41:01 +0300
committerCorinna Vinschen <corinna@vinschen.de>2010-01-17 12:41:01 +0300
commit62910474ac7eaeddb7a51b6fdad14bcc852c9e93 (patch)
treeaa1d861746c43fb791a17a985bdbe2ffc977e01d /winsup/cygwin
parent32cb8c8cfe21f747b507ec34aa81f717b766c38f (diff)
* syscalls.cc (internal_setlocale): Use UTF-8 internally if external
charset is ASCII.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/syscalls.cc12
2 files changed, 15 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 1e0512614..e9d961a7c 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-17 Corinna Vinschen <corinna@vinschen.de>
+
+ * syscalls.cc (internal_setlocale): Use UTF-8 internally if external
+ charset is ASCII.
+
2010-01-15 Corinna Vinschen <corinna@vinschen.de>
* libc/fnmatch.c: Replace with multibyte capable version from FreeBSD.
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index fb39a5d77..6adb941ad 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -4348,8 +4348,16 @@ internal_setlocale ()
cwdstuff::cwd_lock.acquire ();
sys_mbstowcs (w_cwd, 32768, cygheap->cwd.get_posix ());
/* Set charset for internal conversion functions. */
- cygheap->locale.mbtowc = __mbtowc;
- cygheap->locale.wctomb = __wctomb;
+ if (*__locale_charset () == 'A'/*SCII*/)
+ {
+ cygheap->locale.mbtowc = __utf8_mbtowc;
+ cygheap->locale.wctomb = __utf8_wctomb;
+ }
+ else
+ {
+ cygheap->locale.mbtowc = __mbtowc;
+ cygheap->locale.wctomb = __wctomb;
+ }
strcpy (cygheap->locale.charset, __locale_charset ());
/* Restore CWD and PATH in new charset. */
cygheap->cwd.reset_posix (w_cwd);