Skip to content

Commit 94af6bb

Browse files
committed
locale: Add SHIFT-JIS as another name for SJIS
The iconv code uses SHIFT-JIS, so match that. Signed-off-by: Keith Packard <[email protected]>
1 parent e33b659 commit 94af6bb

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

newlib/libc/locale/locale.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ for instance <<"C.UTF-8">>, which keeps all settings as in the C locale,
4141
but uses the UTF-8 charset.
4242
4343
The following charsets are recognized:
44-
<<"UTF-8">>, <<"JIS">>, <<"EUCJP">>, <<"SJIS">>, <<"KOI8-R">>, <<"KOI8-U">>,
44+
<<"UTF-8">>, <<"JIS">>, <<"EUCJP">>, <<"SHIFT-JIS">>, <<"KOI8-R">>, <<"KOI8-U">>,
4545
<<"KOI8-T">>, <<"GEORGIAN-PS">>, <<"PT154">>, <<"TIS-620">>, <<"ISO-8859-x">>
4646
with 1 <= x <= 16, or <<"CPxxx">> with xxx in [437, 720, 737, 775, 850, 852,
4747
855, 857, 858, 862, 866, 874, 932, 1125, 1250, 1251, 1252, 1253, 1254, 1255,
@@ -618,9 +618,9 @@ __loadlocale (struct __locale_t *loc, int category, char *new_locale)
618618
break;
619619
case 'S':
620620
case 's':
621-
if (strcasecmp (charset, "SJIS"))
621+
if (strcasecmp (charset, "SJIS") && strcasecmp (charset, "SHIFT-JIS"))
622622
FAIL;
623-
strcpy (charset, "SJIS");
623+
strcpy (charset, "SHIFT-JIS");
624624
mbc_max = 2;
625625
l_wctomb = __sjis_wctomb;
626626
l_mbtowc = __sjis_mbtowc;

test/meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,9 @@ if enable_native_tests
618618
'CP874', 'CP1125', 'CP1250', 'CP1251', 'CP1252', 'CP1253',
619619
'CP1254', 'CP1256', 'CP1257', 'KOI8-R', 'KOI8-U',
620620

621-
'SJIS', 'EUC-JP']
621+
'SHIFT-JIS', 'EUC-JP']
622622
locale = 'C.' + ctype
623-
if ctype == 'SJIS'
623+
if ctype == 'SHIFT-JIS'
624624
ctype = 'SHIFT_JIS'
625625
elif ctype == 'CP437'
626626
ctype = 'IBM437'

test/test-ctype.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ static const char *locales[] = {
103103
"C.CP1254", "C.CP1256", "C.CP1257", "C.KOI8-R", "C.KOI8-U",
104104
#endif
105105
#ifdef HAVE_JIS_CHARSETS
106-
"C.SJIS",
106+
"C.SHIFT-JIS",
107+
"C.EUC-JP",
107108
#endif
108109
};
109110

test/test-encode.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static const char *locales[] = {
7171
#ifdef HAVE_JIS_CHARSETS
7272
#define JIS_START (NUM_LOCALE-2)
7373
"C.EUC-JP",
74-
"C.SJIS",
74+
"C.SHIFT-JIS",
7575
#endif
7676
};
7777

test/test-wctype.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static const char *locales[] = {
111111
"C.CP1254", "C.CP1256", "C.CP1257", "C.KOI8-R", "C.KOI8-U",
112112
#endif
113113
#ifdef HAVE_JIS_CHARSETS
114-
"C.SJIS",
114+
"C.SHIFT-JIS",
115115
"C.EUC-JP",
116116
#endif
117117
};

0 commit comments

Comments
 (0)