diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2016-12-11 16:56:19 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2016-12-14 07:56:05 +0100 |
commit | 4fa7ed9388f3ca81d97cad2099a6f9fa9f8098de (patch) | |
tree | ec4d1325b6b91a30dd0537658fe604bd8661c0b7 /libiconv | |
parent | 5ca03df6978345c297225212cc0ca33d476b0272 (diff) |
add libiconv-tiny implementation
To use it enable UCLIBC_HAS_LIBICONV, then iconv_open/iconv_close
should be available.
Diffstat (limited to 'libiconv')
29 files changed, 1347 insertions, 0 deletions
diff --git a/libiconv/COPYRIGHT b/libiconv/COPYRIGHT new file mode 100644 index 000000000..338241edd --- /dev/null +++ b/libiconv/COPYRIGHT @@ -0,0 +1,19 @@ +Copyright status on all included code: + +All files which have no copyright comments are original works +Copyright (C) 2005-2006 Rich Felker. The decision to exclude such +comments is intentional, as it should be possible to carry around the +complete source code on tiny storage media. All public header files +(include/*) should be treated as Public Domain as they intentionally +contain no content which can be covered by copyright. Some source +modules may fall in this category as well. If you believe that a file +is so trivial that it should be in the Public Domain, please contact +me and, if I agree, I will explicitly release it from copyright. + +Some code has been modified by the OpenWrt project, this includes +the conversion from char map files to C arrays and the iconv.h header +file in particular. + +The library as a whole is licensed under the GNU LGPL version 2.1. + +The original source can be accessed at svn://svn.mplayerhq.hu/libc/trunk diff --git a/libiconv/Makefile b/libiconv/Makefile new file mode 100644 index 000000000..1ffc16ee3 --- /dev/null +++ b/libiconv/Makefile @@ -0,0 +1,9 @@ +# Makefile for uClibc-ng +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + +top_srcdir=../ +top_builddir=../ +include $(top_builddir)Rules.mak +all: libs +include Makefile.in +include $(top_srcdir)Makerules diff --git a/libiconv/Makefile.in b/libiconv/Makefile.in new file mode 100644 index 000000000..3636aa647 --- /dev/null +++ b/libiconv/Makefile.in @@ -0,0 +1,31 @@ +# Makefile for uClibc-ng +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + +subdirs += libiconv + +CFLAGS-libiconv := -DNOT_IN_libc -DIS_IN_libiconv $(SSP_ALL_CFLAGS) \ + -I$(top_srcdir)libiconv/include + +libiconv_DIR := $(top_srcdir)libiconv +libiconv_OUT := $(top_builddir)libiconv + +libiconv_SRC-$(UCLIBC_HAS_LIBICONV) := iconv.c + +libiconv_SRC := $(addprefix $(libiconv_DIR)/,$(libiconv_SRC-y)) +libiconv_OBJ := $(patsubst $(libiconv_DIR)/%.c,$(libiconv_OUT)/%.o,$(libiconv_SRC)) + +ifeq ($(DOPIC),y) +libiconv-a-y := $(libiconv_OBJ:.o=.os) +else +libiconv-a-y := $(libiconv_OBJ) +endif +libiconv-so-y := $(libiconv_OBJ:.o=.os) + +objclean-y += CLEAN_libiconv + +$(libiconv_OUT)/libiconv.oS: $(libiconv_SRC) + $(Q)$(RM) $@ + $(compile-m) + +CLEAN_libiconv: + $(do_rm) $(addprefix $(libiconv_OUT)/*., o os oS a) diff --git a/libiconv/iconv.c b/libiconv/iconv.c new file mode 100644 index 000000000..cb4e94775 --- /dev/null +++ b/libiconv/iconv.c @@ -0,0 +1,440 @@ +#include <iconv.h> +#include <errno.h> +#include <wchar.h> +#include <string.h> +#include <strings.h> +#include <stdlib.h> +#include <limits.h> + +#include <dirent.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <sys/stat.h> +#include <unistd.h> +#include <stdint.h> + +/* builtin charmaps */ +#include "charmaps.h" + +/* only 0-7 are valid as dest charset */ +#define UTF_16BE 000 +#define UTF_16LE 001 +#define UTF_32BE 002 +#define UTF_32LE 003 +#define WCHAR_T 004 +#define UTF_8 005 +#define US_ASCII 006 +#define LATIN_1 007 + +/* additional charsets with algorithmic conversion */ +#define LATIN_9 010 +#define TIS_620 011 +#define JIS_0201 012 + +/* some programs like php need this */ +int _libiconv_version = _LIBICONV_VERSION; + +/* these must match the constants above */ +static const unsigned char charsets[] = + "\005" "UTF-8" "\0" + "\004" "WCHAR_T" "\0" + "\000" "UTF-16BE" "\0" + "\001" "UTF-16LE" "\0" + "\002" "UTF-32BE" "\0" + "\003" "UTF-32LE" "\0" + "\006" "ASCII" "\0" + "\006" "US-ASCII" "\0" + "\007" "ISO-8859-1" "\0" + "\007" "LATIN1" "\0" + "\010" "ISO-8859-15""\0" + "\010" "LATIN9" "\0" + "\011" "ISO-8859-11""\0" + "\011" "TIS-620" "\0" + "\012" "JIS-0201" "\0" + "\377"; + +/* separate identifiers for sbcs/dbcs/etc map type */ +#define UCS2_8BIT 000 +#define UCS3_8BIT 001 +#define EUC 002 +#define EUC_TW 003 +#define SHIFT_JIS 004 +#define BIG5 005 +#define GBK 006 + +/* FIXME: these are not implemented yet +// EUC: A1-FE A1-FE +// GBK: 81-FE 40-7E,80-FE +// Big5: A1-FE 40-7E,A1-FE +*/ + +static const unsigned short maplen[] = { + [UCS2_8BIT] = 4+ 2* 128, + [UCS3_8BIT] = 4+ 3* 128, + [EUC] = 4+ 2* 94*94, + [SHIFT_JIS] = 4+ 2* 94*94, + [BIG5] = 4+ 2* 94*157, + [GBK] = 4+ 2* 126*190, + [EUC_TW] = 4+ 2* 2*94*94, +}; + +static int find_charmap(const char *name) +{ + int i; + for (i = 0; i < (sizeof(charmaps) / sizeof(charmaps[0])); i++) + if (!strcasecmp(charmaps[i].name, name)) + return i; + return -1; +} + +static int find_charset(const char *name) +{ + const unsigned char *s; + for (s=charsets; *s<0xff && strcasecmp(s+1, name); s+=strlen(s)+1); + return *s; +} + +iconv_t iconv_open(const char *to, const char *from) +{ + unsigned f, t; + int m; + + if ((t = find_charset(to)) > 8) + return -1; + + if ((f = find_charset(from)) < 255) + return 0 | (t<<1) | (f<<8); + + if ((m = find_charmap(from)) > -1) + return 1 | (t<<1) | (m<<8); + + return -1; +} + +int iconv_close(iconv_t cd) +{ + return 0; +} + +static inline wchar_t get_16(const unsigned char *s, int endian) +{ + endian &= 1; + return s[endian]<<8 | s[endian^1]; +} + +static inline void put_16(unsigned char *s, wchar_t c, int endian) +{ + endian &= 1; + s[endian] = c>>8; + s[endian^1] = c; +} + +static inline int utf8enc_wchar(char *outb, wchar_t c) +{ + if (c <= 0x7F) { + *outb = c; + return 1; + } + else if (c <= 0x7FF) { + *outb++ = ((c >> 6) & 0x1F) | 0xC0; + *outb++ = ( c & 0x3F) | 0x80; + return 2; + } + else if (c <= 0xFFFF) { + *outb++ = ((c >> 12) & 0x0F) | 0xE0; + *outb++ = ((c >> 6) & 0x3F) | 0x80; + *outb++ = ( c & 0x3F) | 0x80; + return 3; + } + else if (c <= 0x10FFFF) { + *outb++ = ((c >> 18) & 0x07) | 0xF0; + *outb++ = ((c >> 12) & 0x3F) | 0x80; + *outb++ = ((c >> 6) & 0x3F) | 0x80; + *outb++ = ( c & 0x3F) | 0x80; + return 4; + } + else { + *outb++ = '?'; + return 1; + } +} + +static inline int utf8seq_is_overlong(char *s, int n) +{ + switch (n) + { + case 2: + /* 1100000x (10xxxxxx) */ + return (((*s >> 1) == 0x60) && + ((*(s+1) >> 6) == 0x02)); + + case 3: + /* 11100000 100xxxxx (10xxxxxx) */ + return ((*s == 0xE0) && + ((*(s+1) >> 5) == 0x04) && + ((*(s+2) >> 6) == 0x02)); + + case 4: + /* 11110000 1000xxxx (10xxxxxx 10xxxxxx) */ + return ((*s == 0xF0) && + ((*(s+1) >> 4) == 0x08) && + ((*(s+2) >> 6) == 0x02) && + ((*(s+3) >> 6) == 0x02)); + } + + return 0; +} + +static inline int utf8seq_is_surrogate(char *s, int n) +{ + return ((n == 3) && (*s == 0xED) && (*(s+1) >= 0xA0) && (*(s+1) <= 0xBF)); +} + +static inline int utf8seq_is_illegal(char *s, int n) +{ + return ((n == 3) && (*s == 0xEF) && (*(s+1) == 0xBF) && + (*(s+2) >= 0xBE) && (*(s+2) <= 0xBF)); +} + +static inline int utf8dec_wchar(wchar_t *c, unsigned char *in, size_t inb) +{ + int i; + int n = -1; + + /* trivial char */ + if (*in <= 0x7F) { + *c = *in; + return 1; + } + + /* find utf8 sequence length */ + if ((*in & 0xE0) == 0xC0) n = 2; + else if ((*in & 0xF0) == 0xE0) n = 3; + else if ((*in & 0xF8) == 0xF0) n = 4; + else if ((*in & 0xFC) == 0xF8) n = 5; + else if ((*in & 0xFE) == 0xFC) n = 6; + + /* starved? */ + if (n > inb) + return -2; + + /* decode ... */ + if (n > 1 && n < 5) { + /* reject invalid sequences */ + if (utf8seq_is_overlong(in, n) || + utf8seq_is_surrogate(in, n) || + utf8seq_is_illegal(in, n)) + return -1; + + /* decode ... */ + *c = (char)(*in++ & (0x7F >> n)); + + for (i = 1; i < n; i++) { + /* illegal continuation byte */ + if (*in < 0x80 || *in > 0xBF) + return -1; + + *c = (*c << 6) | (*in++ & 0x3F); + } + + return n; + } + + /* unmapped sequence (> 4) */ + return -1; +} + +static inline char latin9_translit(wchar_t c) +{ + /* a number of trivial iso-8859-15 <> utf-8 transliterations */ + switch (c) { + case 0x20AC: return 0xA4; /* Euro */ + case 0x0160: return 0xA6; /* S caron */ + case 0x0161: return 0xA8; /* s caron */ + case 0x017D: return 0xB4; /* Z caron */ + case 0x017E: return 0xB8; /* z caron */ + case 0x0152: return 0xBC; /* OE */ + case 0x0153: return 0xBD; /* oe */ + case 0x0178: return 0xBE; /* Y diaeresis */ + default: return '?'; + } +} + +size_t iconv(iconv_t cd, char **in, size_t *inb, char **out, size_t *outb) +{ + size_t x=0; + unsigned char to = (cd>>1)&127; + unsigned char from = 255; + const unsigned char *map = 0; + char tmp[MB_LEN_MAX]; + wchar_t c, d; + size_t k, l; + int err; + + if (!in || !*in || !*inb) return 0; + + if (cd & 1) + map = charmaps[cd>>8].map; + else + from = cd>>8; + + for (; *inb; *in+=l, *inb-=l) { + c = *(unsigned char *)*in; + l = 1; + if (from >= UTF_8 && c < 0x80) goto charok; + switch (from) { + case WCHAR_T: + l = sizeof(wchar_t); + if (*inb < l) goto starved; + c = *(wchar_t *)*in; + break; + case UTF_8: + l = utf8dec_wchar(&c, *in, *inb); + if (!l) l++; + else if (l == (size_t)-1) goto ilseq; + else if (l == (size_t)-2) goto starved; + break; + case US_ASCII: + goto ilseq; + case LATIN_9: + if ((unsigned)c - 0xa4 <= 0xbe - 0xa4) { + static const unsigned char map[] = { + 0, 0x60, 0, 0x61, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x7d, 0, 0, 0, 0x7e, 0, 0, 0, + 0x52, 0x53, 0x78 + }; + if (c == 0xa4) c = 0x20ac; + else if (map[c-0xa5]) c = 0x100 | map[c-0xa5]; + } + case LATIN_1: + goto charok; + case TIS_620: + if (c >= 0xa1) c += 0x0e01-0xa1; + goto charok; + case JIS_0201: + if (c >= 0xa1) { + if (c <= 0xdf) c += 0xff61-0xa1; + else goto ilseq; + } + goto charok; + case UTF_16BE: + case UTF_16LE: + l = 2; + if (*inb < 2) goto starved; + c = get_16(*in, from); + if ((unsigned)(c-0xdc00) < 0x400) goto ilseq; + if ((unsigned)(c-0xd800) < 0x400) { + l = 4; + if (*inb < 4) goto starved; + d = get_16(*in + 2, from); + if ((unsigned)(c-0xdc00) >= 0x400) goto ilseq; + c = ((c-0xd800)<<10) | (d-0xdc00); + } + break; + case UTF_32BE: + case UTF_32LE: + l = 4; + if (*inb < 4) goto starved; + // FIXME + // c = get_32(*in, from); + break; + default: + /* only support ascii supersets */ + if (c < 0x80) break; + switch (map[0]) { + case UCS2_8BIT: + c -= 0x80; + break; + case EUC: + if ((unsigned)c - 0xa1 >= 94) goto ilseq; + if ((unsigned)in[0][1] - 0xa1 >= 94) goto ilseq; + c = (c-0xa1)*94 + (in[0][1]-0xa1); + l = 2; + break; + case SHIFT_JIS: + if ((unsigned)c - 0xa1 <= 0xdf-0xa1) { + c += 0xff61-0xa1; + goto charok; + } + // FIXME... + l = 2; + break; + default: + goto badf; + } + c = get_16(map + 4 + 2*c, 0); + if (c == 0xffff) goto ilseq; + goto charok; + } + + if ((unsigned)c - 0xd800 < 0x800 || (unsigned)c >= 0x110000) + goto ilseq; +charok: + switch (to) { + case WCHAR_T: + if (*outb < sizeof(wchar_t)) goto toobig; + *(wchar_t *)*out = c; + *out += sizeof(wchar_t); + *outb -= sizeof(wchar_t); + break; + case UTF_8: + if (*outb < 4) { + k = utf8enc_wchar(tmp, c); + if (*outb < k) goto toobig; + memcpy(*out, tmp, k); + } else k = utf8enc_wchar(*out, c); + *out += k; + *outb -= k; + break; + case US_ASCII: + if (c > 0x7f) c = 0xfffd; + /* fall thru and count replacement in latin1 case */ + case LATIN_9: + if (c >= 0x100 && c != 0xfffd) + c = latin9_translit(c); + /* fall through */ + case LATIN_1: + if (!*outb) goto toobig; + if (c < 0x100) **out = c; + else x++, **out = '*'; //FIXME: translit? + ++*out; + --*outb; + break; + case UTF_16BE: + case UTF_16LE: + if (c < 0x10000) { + if (*outb < 2) goto toobig; + put_16(*out, c, to); + *out += 2; + *outb -= 2; + break; + } + if (*outb < 4) goto toobig; + put_16(*out, (c>>10)|0xd800, to); + put_16(*out + 2, (c&0x3ff)|0xdc00, to); + *out += 4; + *outb -= 4; + break; + default: + goto badf; + } + } + return x; +ilseq: + err = EILSEQ; + x = -1; + goto end; +badf: + err = EBADF; + x = -1; + goto end; +toobig: + err = E2BIG; + x = -1; + goto end; +starved: + err = EINVAL; +end: + errno = err; + return x; +} diff --git a/libiconv/include/charmaps.h b/libiconv/include/charmaps.h new file mode 100644 index 000000000..083cd699f --- /dev/null +++ b/libiconv/include/charmaps.h @@ -0,0 +1,80 @@ +#include "charmaps/iso-8859-2.h" +#include "charmaps/iso-8859-10.h" +#include "charmaps/windows-874.h" +#include "charmaps/windows-1250.h" +#include "charmaps/koi8-r.h" + +#ifdef ALL_CHARSETS +#include "charmaps/iso-8859-3.h" +#include "charmaps/iso-8859-4.h" +#include "charmaps/iso-8859-5.h" +#include "charmaps/iso-8859-6.h" +#include "charmaps/iso-8859-7.h" +#include "charmaps/iso-8859-8.h" +#include "charmaps/iso-8859-9.h" +#include "charmaps/iso-8859-13.h" +#include "charmaps/iso-8859-14.h" +#include "charmaps/iso-8859-16.h" +#include "charmaps/windows-1251.h" +#include "charmaps/windows-1252.h" +#include "charmaps/windows-1253.h" +#include "charmaps/windows-1254.h" +#include "charmaps/windows-1255.h" +#include "charmaps/windows-1256.h" +#include "charmaps/windows-1257.h" +#include "charmaps/windows-1258.h" +#endif + + +struct charmap { + const char name[13]; + const unsigned char *map; +}; + +static struct charmap charmaps[] = { + { "ISO-8859-2", map_iso_8859_2 }, + { "ISO-8859-10", map_iso_8859_10 }, + +#ifdef ALL_CHARSETS + { "ISO-8859-3", map_iso_8859_3 }, + { "ISO-8859-4", map_iso_8859_4 }, + { "ISO-8859-5", map_iso_8859_5 }, + { "ISO-8859-6", map_iso_8859_6 }, + { "ISO-8859-7", map_iso_8859_7 }, + { "ISO-8859-8", map_iso_8859_8 }, + { "ISO-8859-9", map_iso_8859_9 }, + { "ISO-8859-13", map_iso_8859_13 }, + { "ISO-8859-14", map_iso_8859_14 }, + { "ISO-8859-16", map_iso_8859_16 }, +#endif + + { "WINDOWS-874", map_windows_874 }, + { "WINDOWS-1250", map_windows_1250 }, + +#ifdef ALL_CHARSETS + { "WINDOWS-1251", map_windows_1251 }, + { "WINDOWS-1252", map_windows_1252 }, + { "WINDOWS-1253", map_windows_1253 }, + { "WINDOWS-1254", map_windows_1254 }, + { "WINDOWS-1255", map_windows_1255 }, + { "WINDOWS-1256", map_windows_1256 }, + { "WINDOWS-1257", map_windows_1257 }, + { "WINDOWS-1258", map_windows_1258 }, +#endif + + { "KOI8-R", map_koi8_r }, + + /* Aliases */ + { "LATIN2", map_iso_8859_2 }, + { "LATIN6", map_iso_8859_10 }, + +#ifdef ALL_CHARSETS + { "ARABIC", map_iso_8859_6 }, + { "CYRILLIC", map_iso_8859_5 }, + { "GREEK", map_iso_8859_7 }, + { "HEBREW", map_iso_8859_8 }, + { "LATIN3", map_iso_8859_3 }, + { "LATIN4", map_iso_8859_4 }, + { "LATIN5", map_iso_8859_9 }, +#endif +}; diff --git a/libiconv/include/charmaps/iso-8859-10.h b/libiconv/include/charmaps/iso-8859-10.h new file mode 100644 index 000000000..cb93d027d --- /dev/null +++ b/libiconv/include/charmaps/iso-8859-10.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_10[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x01, 0x04, + 0x01, 0x12, 0x01, 0x22, 0x01, 0x2a, 0x01, 0x28, 0x01, 0x36, 0x00, 0xa7, + 0x01, 0x3b, 0x01, 0x10, 0x01, 0x60, 0x01, 0x66, 0x01, 0x7d, 0x00, 0xad, + 0x01, 0x6a, 0x01, 0x4a, 0x00, 0xb0, 0x01, 0x05, 0x01, 0x13, 0x01, 0x23, + 0x01, 0x2b, 0x01, 0x29, 0x01, 0x37, 0x00, 0xb7, 0x01, 0x3c, 0x01, 0x11, + 0x01, 0x61, 0x01, 0x67, 0x01, 0x7e, 0x20, 0x15, 0x01, 0x6b, 0x01, 0x4b, + 0x01, 0x00, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3, 0x00, 0xc4, 0x00, 0xc5, + 0x00, 0xc6, 0x01, 0x2e, 0x01, 0x0c, 0x00, 0xc9, 0x01, 0x18, 0x00, 0xcb, + 0x01, 0x16, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0x00, 0xd0, 0x01, 0x45, + 0x01, 0x4c, 0x00, 0xd3, 0x00, 0xd4, 0x00, 0xd5, 0x00, 0xd6, 0x01, 0x68, + 0x00, 0xd8, 0x01, 0x72, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x00, 0xdd, + 0x00, 0xde, 0x00, 0xdf, 0x01, 0x01, 0x00, 0xe1, 0x00, 0xe2, 0x00, 0xe3, + 0x00, 0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x01, 0x2f, 0x01, 0x0d, 0x00, 0xe9, + 0x01, 0x19, 0x00, 0xeb, 0x01, 0x17, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0x00, 0xf0, 0x01, 0x46, 0x01, 0x4d, 0x00, 0xf3, 0x00, 0xf4, 0x00, 0xf5, + 0x00, 0xf6, 0x01, 0x69, 0x00, 0xf8, 0x01, 0x73, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x00, 0xfd, 0x00, 0xfe, 0x01, 0x38 +}; diff --git a/libiconv/include/charmaps/iso-8859-13.h b/libiconv/include/charmaps/iso-8859-13.h new file mode 100644 index 000000000..b44d1b434 --- /dev/null +++ b/libiconv/include/charmaps/iso-8859-13.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_13[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x20, 0x1d, + 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa4, 0x20, 0x1e, 0x00, 0xa6, 0x00, 0xa7, + 0x00, 0xd8, 0x00, 0xa9, 0x01, 0x56, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, + 0x00, 0xae, 0x00, 0xc6, 0x00, 0xb0, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xb3, + 0x20, 0x1c, 0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xf8, 0x00, 0xb9, + 0x01, 0x57, 0x00, 0xbb, 0x00, 0xbc, 0x00, 0xbd, 0x00, 0xbe, 0x00, 0xe6, + 0x01, 0x04, 0x01, 0x2e, 0x01, 0x00, 0x01, 0x06, 0x00, 0xc4, 0x00, 0xc5, + 0x01, 0x18, 0x01, 0x12, 0x01, 0x0c, 0x00, 0xc9, 0x01, 0x79, 0x01, 0x16, + 0x01, 0x22, 0x01, 0x36, 0x01, 0x2a, 0x01, 0x3b, 0x01, 0x60, 0x01, 0x43, + 0x01, 0x45, 0x00, 0xd3, 0x01, 0x4c, 0x00, 0xd5, 0x00, 0xd6, 0x00, 0xd7, + 0x01, 0x72, 0x01, 0x41, 0x01, 0x5a, 0x01, 0x6a, 0x00, 0xdc, 0x01, 0x7b, + 0x01, 0x7d, 0x00, 0xdf, 0x01, 0x05, 0x01, 0x2f, 0x01, 0x01, 0x01, 0x07, + 0x00, 0xe4, 0x00, 0xe5, 0x01, 0x19, 0x01, 0x13, 0x01, 0x0d, 0x00, 0xe9, + 0x01, 0x7a, 0x01, 0x17, 0x01, 0x23, 0x01, 0x37, 0x01, 0x2b, 0x01, 0x3c, + 0x01, 0x61, 0x01, 0x44, 0x01, 0x46, 0x00, 0xf3, 0x01, 0x4d, 0x00, 0xf5, + 0x00, 0xf6, 0x00, 0xf7, 0x01, 0x73, 0x01, 0x42, 0x01, 0x5b, 0x01, 0x6b, + 0x00, 0xfc, 0x01, 0x7c, 0x01, 0x7e, 0x20, 0x19 +}; diff --git a/libiconv/include/charmaps/iso-8859-14.h b/libiconv/include/charmaps/iso-8859-14.h new file mode 100644 index 000000000..76cead98c --- /dev/null +++ b/libiconv/include/charmaps/iso-8859-14.h @@ -0,0 +1,25 @@ +static const unsigned char map_iso_8859_14[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x1e, 0x02, + 0x1e, 0x03, 0x00, 0xa3, 0x01, 0x0a, 0x01, 0x0b, 0x1e, 0x0a, 0x00, 0xa7, + 0x1e, 0x80, 0x00, 0xa9, 0x1e, 0x82, 0x1e, 0x0b, 0x1e, 0xf2, 0x00, 0xad, + 0x00, 0xae, 0x01, 0x78, 0x1e, 0x1e, 0x1e, 0x1f, 0x01, 0x20, 0x01, 0x21, + 0x1e, 0x40, 0x1e, 0x41, 0x00, 0xb6, 0x1e, 0x56, 0x1e, 0x81, 0x1e, 0x57, + 0x1e, 0x83, 0x1e, 0x60, 0x1e, 0xf3, 0x1e, 0x84, 0x1e, 0x85, 0x1e, 0x61, + 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3, 0x00, 0xc4, 0x00, 0xc5, + 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xcb, + 0x00, 0xcc, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0x01, 0x74, 0x00, 0xd1, + 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x00, 0xd5, 0x00, 0xd6, 0x1e, 0x6a, + 0x00, 0xd8, 0x00, 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x00, 0xdd, + 0x01, 0x76, 0x00, 0xdf, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0x00, 0xe3, + 0x00, 0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, + 0x00, 0xea, 0x00, 0xeb, 0x00, 0xec, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0x01, 0x75, 0x00, 0xf1, 0x00, 0xf2, 0x00, 0xf3, 0x00, 0xf4, 0x00, 0xf5, + 0x00, 0xf6, 0x1e, 0x6b, 0x00, 0xf8, 0x00, 0xf9, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x00, 0xfd, 0x01, 0x77, 0x00, 0xff +}; + diff --git a/libiconv/include/charmaps/iso-8859-16.h b/libiconv/include/charmaps/iso-8859-16.h new file mode 100644 index 000000000..4437a41f0 --- /dev/null +++ b/libiconv/include/charmaps/iso-8859-16.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_16[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x01, 0x04, + 0x01, 0x05, 0x01, 0x41, 0x20, 0xac, 0x20, 0x1e, 0x01, 0x60, 0x00, 0xa7, + 0x01, 0x61, 0x00, 0xa9, 0x02, 0x18, 0x00, 0xab, 0x01, 0x79, 0x00, 0xad, + 0x01, 0x7a, 0x01, 0x7b, 0x00, 0xb0, 0x00, 0xb1, 0x01, 0x0c, 0x01, 0x42, + 0x01, 0x7d, 0x20, 0x1d, 0x00, 0xb6, 0x00, 0xb7, 0x01, 0x7e, 0x01, 0x0d, + 0x02, 0x19, 0x00, 0xbb, 0x01, 0x52, 0x01, 0x53, 0x01, 0x78, 0x01, 0x7c, + 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x01, 0x02, 0x00, 0xc4, 0x01, 0x06, + 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xcb, + 0x00, 0xcc, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0x01, 0x10, 0x01, 0x43, + 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x01, 0x50, 0x00, 0xd6, 0x01, 0x5a, + 0x01, 0x70, 0x00, 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x01, 0x18, + 0x02, 0x1a, 0x00, 0xdf, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0x01, 0x03, + 0x00, 0xe4, 0x01, 0x07, 0x00, 0xe6, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, + 0x00, 0xea, 0x00, 0xeb, 0x00, 0xec, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0x01, 0x11, 0x01, 0x44, 0x00, 0xf2, 0x00, 0xf3, 0x00, 0xf4, 0x01, 0x51, + 0x00, 0xf6, 0x01, 0x5b, 0x01, 0x71, 0x00, 0xf9, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x01, 0x19, 0x02, 0x1b, 0x00, 0xff +}; diff --git a/libiconv/include/charmaps/iso-8859-2.h b/libiconv/include/charmaps/iso-8859-2.h new file mode 100644 index 000000000..631610e17 --- /dev/null +++ b/libiconv/include/charmaps/iso-8859-2.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_2[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x01, 0x04, + 0x02, 0xd8, 0x01, 0x41, 0x00, 0xa4, 0x01, 0x3d, 0x01, 0x5a, 0x00, 0xa7, + 0x00, 0xa8, 0x01, 0x60, 0x01, 0x5e, 0x01, 0x64, 0x01, 0x79, 0x00, 0xad, + 0x01, 0x7d, 0x01, 0x7b, 0x00, 0xb0, 0x01, 0x05, 0x02, 0xdb, 0x01, 0x42, + 0x00, 0xb4, 0x01, 0x3e, 0x01, 0x5b, 0x02, 0xc7, 0x00, 0xb8, 0x01, 0x61, + 0x01, 0x5f, 0x01, 0x65, 0x01, 0x7a, 0x02, 0xdd, 0x01, 0x7e, 0x01, 0x7c, + 0x01, 0x54, 0x00, 0xc1, 0x00, 0xc2, 0x01, 0x02, 0x00, 0xc4, 0x01, 0x39, + 0x01, 0x06, 0x00, 0xc7, 0x01, 0x0c, 0x00, 0xc9, 0x01, 0x18, 0x00, 0xcb, + 0x01, 0x1a, 0x00, 0xcd, 0x00, 0xce, 0x01, 0x0e, 0x01, 0x10, 0x01, 0x43, + 0x01, 0x47, 0x00, 0xd3, 0x00, 0xd4, 0x01, 0x50, 0x00, 0xd6, 0x00, 0xd7, + 0x01, 0x58, 0x01, 0x6e, 0x00, 0xda, 0x01, 0x70, 0x00, 0xdc, 0x00, 0xdd, + 0x01, 0x62, 0x00, 0xdf, 0x01, 0x55, 0x00, 0xe1, 0x00, 0xe2, 0x01, 0x03, + 0x00, 0xe4, 0x01, 0x3a, 0x01, 0x07, 0x00, 0xe7, 0x01, 0x0d, 0x00, 0xe9, + 0x01, 0x19, 0x00, 0xeb, 0x01, 0x1b, 0x00, 0xed, 0x00, 0xee, 0x01, 0x0f, + 0x01, 0x11, 0x01, 0x44, 0x01, 0x48, 0x00, 0xf3, 0x00, 0xf4, 0x01, 0x51, + 0x00, 0xf6, 0x00, 0xf7, 0x01, 0x59, 0x01, 0x6f, 0x00, 0xfa, 0x01, 0x71, + 0x00, 0xfc, 0x00, 0xfd, 0x01, 0x63, 0x02, 0xd9 +}; diff --git a/libiconv/include/charmaps/iso-8859-3.h b/libiconv/include/charmaps/iso-8859-3.h new file mode 100644 index 000000000..cd76d59c6 --- /dev/null +++ b/libiconv/include/charmaps/iso-8859-3.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_3[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x01, 0x26, + 0x02, 0xd8, 0x00, 0xa3, 0x00, 0xa4, 0xff, 0xff, 0x01, 0x24, 0x00, 0xa7, + 0x00, 0xa8, 0x01, 0x30, 0x01, 0x5e, 0x01, 0x1e, 0x01, 0x34, 0x00, 0xad, + 0xff, 0xff, 0x01, 0x7b, 0x00, 0xb0, 0x01, 0x27, 0x00, 0xb2, 0x00, 0xb3, + 0x00, 0xb4, 0x00, 0xb5, 0x01, 0x25, 0x00, 0xb7, 0x00, 0xb8, 0x01, 0x31, + 0x01, 0x5f, 0x01, 0x1f, 0x01, 0x35, 0x00, 0xbd, 0xff, 0xff, 0x01, 0x7c, + 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0xff, 0xff, 0x00, 0xc4, 0x01, 0x0a, + 0x01, 0x08, 0x00, 0xc7, 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xcb, + 0x00, 0xcc, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0xff, 0xff, 0x00, 0xd1, + 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x01, 0x20, 0x00, 0xd6, 0x00, 0xd7, + 0x01, 0x1c, 0x00, 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x01, 0x6c, + 0x01, 0x5c, 0x00, 0xdf, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0xff, 0xff, + 0x00, 0xe4, 0x01, 0x0b, 0x01, 0x09, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, + 0x00, 0xea, 0x00, 0xeb, 0x00, 0xec, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, + 0xff, 0xff, 0x00, 0xf1, 0x00, 0xf2, 0x00, 0xf3, 0x00, 0xf4, 0x01, 0x21, + 0x00, 0xf6, 0x00, 0xf7, 0x01, 0x1d, 0x00, 0xf9, 0x00, 0xfa, 0x00, 0xfb, + 0x00, 0xfc, 0x01, 0x6d, 0x01, 0x5d, 0x02, 0xd9 +}; diff --git a/libiconv/include/charmaps/iso-8859-4.h b/libiconv/include/charmaps/iso-8859-4.h new file mode 100644 index 000000000..5db2f7780 --- /dev/null +++ b/libiconv/include/charmaps/iso-8859-4.h @@ -0,0 +1,24 @@ +static const unsigned char map_iso_8859_4[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, + 0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x95, + 0x00, 0x96, 0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 0x00, 0x9b, + 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 0x01, 0x04, + 0x01, 0x38, 0x01, 0x56, 0x00, 0xa4, 0x01, 0x28, 0x01, 0x3b, 0x00, 0xa7, + 0x00, 0xa8, 0x01, 0x60, 0x01, 0x12, 0x01, 0x22, 0x01, 0x66, 0x00, 0xad, + 0x01, 0x7d, 0x00, 0xaf, 0x00, 0xb0, 0 |