- const char *charset; /* Note: expected to be lowercase */
- const char *iconv_name; /* Note: expected to be properly cased for iconv_open() */
-} known_iconv_charsets[] = {
- /* charset name, iconv-friendly name (sometimes case sensitive) */
- { "utf-8", "UTF-8" },
- { "utf8", "UTF-8" },
-
- /* ANSI_X3.4-1968 is used on some systems and should be
- treated the same as US-ASCII */
- { "ansi_x3.4-1968", NULL },
-
- /* 10646 is a special case, its usually UCS-2 big endian */
- /* This might need some checking but should be ok for
- solaris/linux */
- { "iso-10646-1", "UCS-2BE" },
- { "iso_10646-1", "UCS-2BE" },
- { "iso10646-1", "UCS-2BE" },
- { "iso-10646", "UCS-2BE" },
- { "iso_10646", "UCS-2BE" },
- { "iso10646", "UCS-2BE" },
-
- /* Korean charsets */
- /* Note: according to http://www.iana.org/assignments/character-sets,
- * ks_c_5601-1987 should really map to ISO-2022-KR, but the EUC-KR
- * mapping was given to me via a native Korean user, so I'm not sure
- * if I should change this... perhaps they are compatable? */
- { "ks_c_5601-1987", "EUC-KR" },
- { "5601", "EUC-KR" },
- { "ksc-5601", "EUC-KR" },
- { "ksc-5601-1987", "EUC-KR" },
- { "ksc-5601_1987", "EUC-KR" },
- { "ks_c_5861-1992", "EUC-KR" },
- { "euckr-0", "EUC-KR" },
-
- /* Chinese charsets */
- { "big5-0", "BIG5" },
- { "big5.eten-0", "BIG5" },
- { "big5hkscs-0", "BIG5HKSCS" },
- /* Note: GBK is a superset of gb2312 (see
- * http://en.wikipedia.org/wiki/GBK for details), so 'upgrade'
- * gb2312 to GBK so that we can completely convert GBK text
- * that is incorrectly tagged as gb2312 to UTF-8. */
- { "gb2312", "GBK" },
- { "gb-2312", "GBK" },
- { "gb2312-0", "GBK" },
- { "gb2312-80", "GBK" },
- { "gb2312.1980-0", "GBK" },
- /* euc-cn is an alias for gb2312 */
- { "euc-cn", "GBK" },
- { "gb18030-0", "gb18030" },
- { "gbk-0", "GBK" },
-
- /* Japanese charsets */
- { "eucjp-0", "eucJP" }, /* should this map to "EUC-JP" instead? */
- { "ujis-0", "ujis" }, /* we might want to map this to EUC-JP */
- { "jisx0208.1983-0", "SJIS" },
- { "jisx0212.1990-0", "SJIS" },
- { "pck", "SJIS" },
- { NULL, NULL }
+ const char *name;
+ Decoder decoder;
+ Encoder encoder;
+} charsets[] = {
+ { "UTF-32BE", decode_utf32be, encode_utf32be },
+ { "UTF-32LE", decode_utf32le, encode_utf32le },
+ { "UTF-16BE", decode_utf16be, encode_utf16be },
+ { "UTF-16LE", decode_utf16le, encode_utf16le },
+ { "UTF-32", decode_utf32, encode_utf32 },
+ { "UTF-16", decode_utf16, encode_utf16 },
+ { "UTF-8", decode_utf8, encode_utf8 },
+ { "UTF32", decode_utf32, encode_utf32 },
+ { "UTF16", decode_utf16, encode_utf16 },
+ { "UTF8", decode_utf8, encode_utf8 },