Revision | 6018c3787ab9cebcddd039702ddf3c7127651cde (tree) |
---|---|
Time | 2018-02-01 03:43:04 |
Author | Waldemar Brodkorb <wbx@ucli...> |
Commiter | Waldemar Brodkorb |
libiconv: fake EUC_JP support
A lot of packages use the same autoconf macro, fake EUC_JP to
succeed. Tested with wget,libcdio and gnupg.
@@ -30,6 +30,7 @@ | ||
30 | 30 | #define LATIN_9 010 |
31 | 31 | #define TIS_620 011 |
32 | 32 | #define JIS_0201 012 |
33 | +#define EUC_JP 013 | |
33 | 34 | |
34 | 35 | /* some programs like php need this */ |
35 | 36 | int _libiconv_version = _LIBICONV_VERSION; |
@@ -51,12 +52,13 @@ static const unsigned char charsets[] = | ||
51 | 52 | "\011" "ISO-8859-11""\0" |
52 | 53 | "\011" "TIS-620" "\0" |
53 | 54 | "\012" "JIS-0201" "\0" |
55 | + "\013" "EUC-JP" "\0" | |
54 | 56 | "\377"; |
55 | 57 | |
56 | 58 | /* separate identifiers for sbcs/dbcs/etc map type */ |
57 | 59 | #define UCS2_8BIT 000 |
58 | 60 | #define UCS3_8BIT 001 |
59 | -#define EUC 002 | |
61 | +#define EUC_JP 002 | |
60 | 62 | #define EUC_TW 003 |
61 | 63 | #define SHIFT_JIS 004 |
62 | 64 | #define BIG5 005 |
@@ -71,7 +73,7 @@ static const unsigned char charsets[] = | ||
71 | 73 | static const unsigned short maplen[] = { |
72 | 74 | [UCS2_8BIT] = 4+ 2* 128, |
73 | 75 | [UCS3_8BIT] = 4+ 3* 128, |
74 | - [EUC] = 4+ 2* 94*94, | |
76 | + [EUC_JP] = 4+ 2* 94*94, | |
75 | 77 | [SHIFT_JIS] = 4+ 2* 94*94, |
76 | 78 | [BIG5] = 4+ 2* 94*157, |
77 | 79 | [GBK] = 4+ 2* 126*190, |
@@ -345,7 +347,7 @@ size_t iconv(iconv_t cd, char **in, size_t *inb, char **out, size_t *outb) | ||
345 | 347 | case UCS2_8BIT: |
346 | 348 | c -= 0x80; |
347 | 349 | break; |
348 | - case EUC: | |
350 | + case EUC_JP: | |
349 | 351 | if ((unsigned)c - 0xa1 >= 94) goto ilseq; |
350 | 352 | if ((unsigned)in[0][1] - 0xa1 >= 94) goto ilseq; |
351 | 353 | c = (c-0xa1)*94 + (in[0][1]-0xa1); |