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>2011-05-04 12:45:17 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-05-04 12:45:17 +0400
commit6e16da9dec940886d173af96c83935dc4431ba5c (patch)
tree69035ae481eb6e6a4112967bd56578f5db06f849 /newlib/libc/locale/locale.c
parentaa8097021e6f2dbff10416c84cb8e193a57e09e3 (diff)
Cygwin-specific patch from Andy Koppe:
* libc/locale/locale.c (current_categories): On Cygwin, set LC_CTYPE to C.UTF-8 to match initial __wctomb and __mbtowc settings. (lc_ctype_charset): On Cygwin, initialize to "UTF-8". (loadlocale): Remove unused Cygwin-specifc code.
Diffstat (limited to 'newlib/libc/locale/locale.c')
-rw-r--r--newlib/libc/locale/locale.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c
index 37ac5e947..9f9b63962 100644
--- a/newlib/libc/locale/locale.c
+++ b/newlib/libc/locale/locale.c
@@ -235,7 +235,11 @@ char __default_locale[ENCODING_LEN + 1] = DEFAULT_LOCALE;
static char current_categories[_LC_LAST][ENCODING_LEN + 1] = {
"C",
"C",
+#ifdef __CYGWIN__ /* Cygwin starts with LC_CTYPE set to "C.UTF-8". */
+ "C.UTF-8",
+#else
"C",
+#endif
"C",
"C",
"C",
@@ -255,13 +259,12 @@ static const char *__get_locale_env(struct _reent *, int);
#endif /* _MB_CAPABLE */
-#if 0 /*def __CYGWIN__ TODO: temporarily(?) disable C == UTF-8 */
+#ifdef __CYGWIN__
static char lc_ctype_charset[ENCODING_LEN + 1] = "UTF-8";
-static char lc_message_charset[ENCODING_LEN + 1] = "UTF-8";
#else
static char lc_ctype_charset[ENCODING_LEN + 1] = "ASCII";
-static char lc_message_charset[ENCODING_LEN + 1] = "ASCII";
#endif
+static char lc_message_charset[ENCODING_LEN + 1] = "ASCII";
static int lc_ctype_cjk_lang = 0;
char *
@@ -495,11 +498,7 @@ restart:
if (!strcmp (locale, "POSIX"))
strcpy (locale, "C");
if (!strcmp (locale, "C")) /* Default "C" locale */
-#if 0 /*def __CYGWIN__ TODO: temporarily(?) disable C == UTF-8 */
- strcpy (charset, "UTF-8");
-#else
strcpy (charset, "ASCII");
-#endif
else if (locale[0] == 'C'
&& (locale[1] == '-' /* Old newlib style */
|| locale[1] == '.')) /* Extension for the C locale to allow