|
|
@@ -1,14 +1,14 @@
|
|
|
--- a/src/locale/iconv.c
|
|
|
+++ b/src/locale/iconv.c
|
|
|
-@@ -42,6 +42,7 @@ static const unsigned char charmaps[] =
|
|
|
- "ucs4\0ucs4be\0utf32\0utf32be\0\0\300"
|
|
|
- "ucs4le\0utf32le\0\0\303"
|
|
|
- "ascii\0usascii\0iso646\0iso646us\0\0\307"
|
|
|
+@@ -48,6 +48,7 @@ static const unsigned char charmaps[] =
|
|
|
+ "utf16\0\0\312"
|
|
|
+ "ucs4\0utf32\0\0\313"
|
|
|
+ "ucs2\0\0\314"
|
|
|
+#ifdef FULL_ICONV
|
|
|
"eucjp\0\0\320"
|
|
|
"shiftjis\0sjis\0\0\321"
|
|
|
"iso2022jp\0\0\322"
|
|
|
-@@ -50,6 +51,7 @@ static const unsigned char charmaps[] =
|
|
|
+@@ -56,6 +57,7 @@ static const unsigned char charmaps[] =
|
|
|
"gb2312\0\0\332"
|
|
|
"big5\0bigfive\0cp950\0big5hkscs\0\0\340"
|
|
|
"euckr\0ksc5601\0ksx1001\0cp949\0\0\350"
|
|
|
@@ -16,7 +16,7 @@
|
|
|
#include "codepages.h"
|
|
|
;
|
|
|
|
|
|
-@@ -60,6 +62,7 @@ static const unsigned short legacy_chars
|
|
|
+@@ -66,6 +68,7 @@ static const unsigned short legacy_chars
|
|
|
#include "legacychars.h"
|
|
|
};
|
|
|
|
|
|
@@ -24,7 +24,7 @@
|
|
|
static const unsigned short jis0208[84][94] = {
|
|
|
#include "jis0208.h"
|
|
|
};
|
|
|
-@@ -79,6 +82,7 @@ static const unsigned short hkscs[] = {
|
|
|
+@@ -85,6 +88,7 @@ static const unsigned short hkscs[] = {
|
|
|
static const unsigned short ksc[93][94] = {
|
|
|
#include "ksc.h"
|
|
|
};
|
|
|
@@ -32,7 +32,7 @@
|
|
|
|
|
|
static const unsigned short rev_jis[] = {
|
|
|
#include "revjis.h"
|
|
|
-@@ -196,6 +200,7 @@ static unsigned legacy_map(const unsigne
|
|
|
+@@ -205,6 +209,7 @@ static unsigned legacy_map(const unsigne
|
|
|
return x < 256 ? x : legacy_chars[x-256];
|
|
|
}
|
|
|
|
|
|
@@ -40,7 +40,7 @@
|
|
|
static unsigned uni_to_jis(unsigned c)
|
|
|
{
|
|
|
unsigned nel = sizeof rev_jis / sizeof *rev_jis;
|
|
|
-@@ -214,6 +219,7 @@ static unsigned uni_to_jis(unsigned c)
|
|
|
+@@ -223,6 +228,7 @@ static unsigned uni_to_jis(unsigned c)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -48,15 +48,15 @@
|
|
|
|
|
|
size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb)
|
|
|
{
|
|
|
-@@ -285,6 +291,7 @@ size_t iconv(iconv_t cd, char **restrict
|
|
|
- c = ((c-0xd7c0)<<10) + (d-0xdc00);
|
|
|
+@@ -319,6 +325,7 @@ size_t iconv(iconv_t cd, char **restrict
|
|
|
}
|
|
|
- break;
|
|
|
+ type = scd->state;
|
|
|
+ continue;
|
|
|
+#ifdef FULL_ICONV
|
|
|
case SHIFT_JIS:
|
|
|
if (c < 128) break;
|
|
|
if (c-0xa1 <= 0xdf-0xa1) {
|
|
|
-@@ -476,6 +483,7 @@ size_t iconv(iconv_t cd, char **restrict
|
|
|
+@@ -510,6 +517,7 @@ size_t iconv(iconv_t cd, char **restrict
|
|
|
c = ksc[c][d];
|
|
|
if (!c) goto ilseq;
|
|
|
break;
|
|
|
@@ -64,7 +64,7 @@
|
|
|
default:
|
|
|
if (!c) break;
|
|
|
c = legacy_map(map, c);
|
|
|
-@@ -516,6 +524,7 @@ size_t iconv(iconv_t cd, char **restrict
|
|
|
+@@ -550,6 +558,7 @@ size_t iconv(iconv_t cd, char **restrict
|
|
|
}
|
|
|
}
|
|
|
goto subst;
|
|
|
@@ -72,14 +72,14 @@
|
|
|
case SHIFT_JIS:
|
|
|
if (c < 128) goto revout;
|
|
|
if (c == 0xa5) {
|
|
|
-@@ -589,6 +598,7 @@ size_t iconv(iconv_t cd, char **restrict
|
|
|
+@@ -623,6 +632,7 @@ size_t iconv(iconv_t cd, char **restrict
|
|
|
*(*out)++ = 'B';
|
|
|
*outb -= 8;
|
|
|
break;
|
|
|
+#endif
|
|
|
+ case UCS2:
|
|
|
+ totype = UCS2BE;
|
|
|
case UCS2BE:
|
|
|
- case UCS2LE:
|
|
|
- case UTF_16BE:
|
|
|
--- a/src/locale/codepages.h
|
|
|
+++ b/src/locale/codepages.h
|
|
|
@@ -129,6 +129,7 @@
|