From eaa75b70e31aed8ba2823c7b37ff92230dd8c451 Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Wed, 24 Apr 2002 20:53:30 +0000 Subject: * Makefile.am (check-DEJAGNU): New target. (site.exp): Likewise. * acinclude.m4 (NEWLIB_CONFIGURE): Replace AC_CANONICAL_HOST with AC_CANONICAL_SYSTEM. Remove AC_CANONICAL_BUILD. * libc/locale/locale.c (_setlocale_r): Add UTF-8 support. * libc/stdlib/mbtowc_r.c (_mbtowc_r): Likewise. * libc/stdlib/wctomb_r.c (_wctomb_r): Likewise. * testsuite: New directory. * testsuite/config: Likewise. * testsuite/lib: Likewise. * testsuite/newlib.locale: Likewise. * testsuite/newlib.string: Likewise. * testsuite/config/default.exp: New file. * testsuite/lib/checkoutput.exp: New file. * testsuite/lib/newlib.exp: New file. * testsuite/lib/passfail.exp: New file. * testsuite/newlib.locale/UTF-8.c: New file. * testsuite/newlib.locale/UTF-8.exp: New file. * testsuite/newlib.locale/locale.exp: New file. * testsuite/newlib.string/string.exp: New file. * testsuite/newlib.string/tstring.c: New file. --- newlib/libc/locale/locale.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'newlib/libc/locale/locale.c') diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c index e1f45335a..4487f7d47 100644 --- a/newlib/libc/locale/locale.c +++ b/newlib/libc/locale/locale.c @@ -140,13 +140,16 @@ _DEFUN(_setlocale_r, (p, category, locale), { if (strcmp (locale, "C") && strcmp (locale, "") && strcmp (locale, "C") && strcmp (locale, "C-JIS") && - strcmp (locale, "C-EUCJP") && strcmp (locale, "C-SJIS")) + strcmp (locale, "C-EUCJP") && strcmp (locale, "C-SJIS") && + strcmp (locale, "UTF-8")) return 0; strcpy (last_lc_ctype, lc_ctype); strcpy (lc_ctype, locale); - if (!strcmp (locale, "C-JIS")) + if (!strcmp (locale, "UTF-8")) + __mb_cur_max = 6; + else if (!strcmp (locale, "C-JIS")) __mb_cur_max = 8; else if (strlen (locale) > 1) __mb_cur_max = 2; -- cgit v1.2.3