]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: fix LC_CTYPE in global locale to be a real C.UTF-8 locale
authorCorinna Vinschen <corinna@vinschen.de>
Sat, 3 Dec 2022 15:16:15 +0000 (16:16 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Sat, 3 Dec 2022 15:16:30 +0000 (16:16 +0100)
commit8d138c3f66c2beb8a7661e57bb44ce436bf8fc33
tree8736e576ca311cdf0213f4edd844ddb270d0f001
parentb6fcdd03edd1a89f88a31123d08a8d5363c7b3dc
Cygwin: fix LC_CTYPE in global locale to be a real C.UTF-8 locale

https://cygwin.com/pipermail/cygwin/2022-December/252571.html

Cygwin's default locale is "C.UTF-8" as far as LC_CTYPE settings
are concerned.  However, while __global_locale contains fixed
mbtowc and wctomb pointers, the lc_ctype_T pointer is still pointing
to _C_ctype_locale, representing the standard "C" locale.

The problem with this is that the codeset name as well as MB_CUR_MAX
is wrong.

Fix this by introducing a new lc_ctype_T structure called
_C_utf8_ctype_locale, setting the default codeset to "UTF-8" and
MB_CUR_MAX to 6.  Use this as lc_ctype_T pointer in __global_locale
by default on Cygwin.

Fixes: a6a477fa8190 ("POSIX-1.2008 per-thread locales, groundwork part 1")
Co-Authored-By: Takashi Yano <takashi.yano@nifty.ne.jp>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
newlib/libc/locale/lctype.c
newlib/libc/locale/locale.c
newlib/libc/locale/setlocale.h
This page took 0.028338 seconds and 5 git commands to generate.