(lc_message_charset): Ditto.
(loadlocale): Set charset of the "C" locale to "UTF-8" on Cygwin.
* libc/stdlib/mbtowc_r.c (__mbtowc): Default to __utf8_mbtowc on
Cygwin.
* libc/stdlib/wctomb_r.c (__wctomb): Default to __utf8_wctomb on
Cygwin.
+2009-09-27 Corinna Vinschen <corinna@vinschen.de>
+
+ * libc/locale/locale.c (lc_ctype_charset): Set to "UTF-8" on Cygwin.
+ (lc_message_charset): Ditto.
+ (loadlocale): Set charset of the "C" locale to "UTF-8" on Cygwin.
+ * libc/stdlib/mbtowc_r.c (__mbtowc): Default to __utf8_mbtowc on
+ Cygwin.
+ * libc/stdlib/wctomb_r.c (__wctomb): Default to __utf8_wctomb on
+ Cygwin.
+
2009-09-26 Eric Blake <ebb9@byu.net>
* libc/include/sys/unistd.h (execvpe, fexecve) [__CYGWIN__]:
#endif
+#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 int lc_ctype_cjk_lang = 0;
char *
if (!strcmp (locale, "POSIX"))
strcpy (locale, "C");
if (!strcmp (locale, "C")) /* Default "C" locale */
+#ifdef __CYGWIN__
+ strcpy (charset, "UTF-8");
+#else
strcpy (charset, "ASCII");
+#endif
else if (locale[0] == 'C' && locale[1] == '-') /* Old newlib style */
strcpy (charset, locale + 2);
else /* POSIX style */
int (*__mbtowc) (struct _reent *, wchar_t *, const char *, size_t,
const char *, mbstate_t *)
+#ifdef __CYGWIN__
+ = __utf8_mbtowc;
+#else
= __ascii_mbtowc;
+#endif
int
_DEFUN (_mbtowc_r, (r, pwc, s, n, state),
int (*__wctomb) (struct _reent *, char *, wchar_t, const char *charset,
mbstate_t *)
+#ifdef __CYGWIN__
+ = __utf8_wctomb;
+#else
= __ascii_wctomb;
+#endif
int
_DEFUN (_wctomb_r, (r, s, wchar, state),