diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2023-02-24 18:07:26 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2023-02-24 18:40:58 +0300 |
commit | 89eb4bce152f93a9ace37bb7c67941a0e3bf19ae (patch) | |
tree | e2d9eb248baf5f807e83a70b24de9098a6b7c9f8 /newlib/libc/locale | |
parent | ac405ab9bc07789d5576fd823cbaa7eef472b11b (diff) |
Cygwin: support KOI8-T codeset
Used on Linux as default codeset for Tajik. There's no matching
Windows codepage, so fake it as CP103.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/libc/locale')
-rw-r--r-- | newlib/libc/locale/locale.c | 15 | ||||
-rw-r--r-- | newlib/libc/locale/nl_langinfo.c | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c index b0f6314ff..e58ba3dbe 100644 --- a/newlib/libc/locale/locale.c +++ b/newlib/libc/locale/locale.c @@ -50,10 +50,10 @@ but uses the UTF-8 charset. The following charsets are recognized: <<"UTF-8">>, <<"JIS">>, <<"EUCJP">>, <<"SJIS">>, <<"KOI8-R">>, <<"KOI8-U">>, -<<"GEORGIAN-PS">>, <<"PT154">>, <<"TIS-620">>, <<"ISO-8859-x">> with -1 <= x <= 16, or <<"CPxxx">> with xxx in [437, 720, 737, 775, 850, 852, 855, -857, 858, 862, 866, 874, 932, 1125, 1250, 1251, 1252, 1253, 1254, 1255, 1256, -1257, 1258]. +<<"KOI8-T">>, <<"GEORGIAN-PS">>, <<"PT154">>, <<"TIS-620">>, <<"ISO-8859-x">> +with 1 <= x <= 16, or <<"CPxxx">> with xxx in [437, 720, 737, 775, 850, 852, +855, 857, 858, 862, 866, 874, 932, 1125, 1250, 1251, 1252, 1253, 1254, 1255, +1256, 1257, 1258]. Charsets are case insensitive. For instance, <<"EUCJP">> and <<"eucJP">> are equivalent. Charset names with dashes can also be written without @@ -769,7 +769,7 @@ restart: break; case 'K': case 'k': - /* KOI8-R, KOI8-U and the aliases without dash */ + /* KOI8-R, KOI8-U, KOI8-T and the aliases without dash */ if (strncasecmp (charset, "KOI8", 4)) FAIL; c = charset + 4; @@ -785,6 +785,11 @@ restart: val = 21866; strcpy (charset, "CP21866"); } + else if (*c == 'T' || *c == 't') + { + val = 103; + strcpy (charset, "CP103"); + } else FAIL; mbc_max = 1; diff --git a/newlib/libc/locale/nl_langinfo.c b/newlib/libc/locale/nl_langinfo.c index eb984912f..aaa1aef86 100644 --- a/newlib/libc/locale/nl_langinfo.c +++ b/newlib/libc/locale/nl_langinfo.c @@ -233,6 +233,8 @@ do_codeset: ret = "GEORGIAN-PS"; else if (strcmp (ret + 2, "102") == 0) ret = "PT154"; + else if (strcmp (ret + 2, "103") == 0) + ret = "KOI8-T"; } else if (ret[0] == 'S'/*JIS*/) { |