├── AUTHORS ├── CHANGES ├── COPYING ├── LICENSE ├── Makefile.in ├── NOTICE ├── README ├── STATUS ├── apriconv.dep ├── apriconv.dsp ├── apriconv.mak ├── build ├── BaseAddr.ref ├── apr-iconv.m4 ├── gen_aliases.awk ├── modules.mk.win └── preapriconv.dsp ├── buildconf ├── ccs ├── Makefile.in ├── Makefile.win ├── adobe-stdenc.c ├── adobe-symbol.c ├── adobe-zdingbats.c ├── apriconv_ccs_modules.dsp ├── big5.c ├── charset.aliases ├── cns11643-plane1.c ├── cns11643-plane14.c ├── cns11643-plane2.c ├── cp037.c ├── cp038.c ├── cp10000.c ├── cp10006.c ├── cp10007.c ├── cp10029.c ├── cp1006.c ├── cp10079.c ├── cp10081.c ├── cp1026.c ├── cp273.c ├── cp274.c ├── cp275.c ├── cp277.c ├── cp278.c ├── cp280.c ├── cp281.c ├── cp284.c ├── cp285.c ├── cp290.c ├── cp297.c ├── cp420.c ├── cp423.c ├── cp424.c ├── cp437.c ├── cp500.c ├── cp737.c ├── cp775.c ├── cp850.c ├── cp851.c ├── cp852.c ├── cp855.c ├── cp856.c ├── cp857.c ├── cp860.c ├── cp861.c ├── cp862.c ├── cp863.c ├── cp864.c ├── cp865.c ├── cp866.c ├── cp868.c ├── cp869.c ├── cp870.c ├── cp871.c ├── cp874.c ├── cp875.c ├── cp880.c ├── cp891.c ├── cp903.c ├── cp904.c ├── cp905.c ├── cp918.c ├── cp932.c ├── cp936.c ├── cp949.c ├── cp950.c ├── dec-mcs.c ├── ebcdic-at-de-a.c ├── ebcdic-at-de.c ├── ebcdic-ca-fr.c ├── ebcdic-dk-no-a.c ├── ebcdic-dk-no.c ├── ebcdic-es-a.c ├── ebcdic-es-s.c ├── ebcdic-es.c ├── ebcdic-fi-se-a.c ├── ebcdic-fi-se.c ├── ebcdic-fr.c ├── ebcdic-it.c ├── ebcdic-pt.c ├── ebcdic-uk.c ├── ebcdic-us.c ├── gb12345.c ├── gb_2312-80.c ├── hp-roman8.c ├── iso-8859-1.c ├── iso-8859-10.c ├── iso-8859-13.c ├── iso-8859-14.c ├── iso-8859-15.c ├── iso-8859-2.c ├── iso-8859-3.c ├── iso-8859-4.c ├── iso-8859-5.c ├── iso-8859-6.c ├── iso-8859-7.c ├── iso-8859-8.c ├── iso-8859-9.c ├── iso-ir-10.c ├── iso-ir-102.c ├── iso-ir-103.c ├── iso-ir-11.c ├── iso-ir-111.c ├── iso-ir-121.c ├── iso-ir-122.c ├── iso-ir-123.c ├── iso-ir-128.c ├── iso-ir-13.c ├── iso-ir-139.c ├── iso-ir-14.c ├── iso-ir-141.c ├── iso-ir-142.c ├── iso-ir-143.c ├── iso-ir-146.c ├── iso-ir-147.c ├── iso-ir-15.c ├── iso-ir-150.c ├── iso-ir-151.c ├── iso-ir-152.c ├── iso-ir-153.c ├── iso-ir-154.c ├── iso-ir-155.c ├── iso-ir-158.c ├── iso-ir-16.c ├── iso-ir-17.c ├── iso-ir-18.c ├── iso-ir-19.c ├── iso-ir-2.c ├── iso-ir-21.c ├── iso-ir-25.c ├── iso-ir-27.c ├── iso-ir-37.c ├── iso-ir-4.c ├── iso-ir-47.c ├── iso-ir-49.c ├── iso-ir-50.c ├── iso-ir-51.c ├── iso-ir-54.c ├── iso-ir-55.c ├── iso-ir-57.c ├── iso-ir-60.c ├── iso-ir-61.c ├── iso-ir-69.c ├── iso-ir-70.c ├── iso-ir-8-1.c ├── iso-ir-8-2.c ├── iso-ir-84.c ├── iso-ir-85.c ├── iso-ir-86.c ├── iso-ir-88.c ├── iso-ir-89.c ├── iso-ir-9-1.c ├── iso-ir-9-2.c ├── iso-ir-90.c ├── iso-ir-91.c ├── iso-ir-92.c ├── iso-ir-93.c ├── iso-ir-94.c ├── iso-ir-95.c ├── iso-ir-96.c ├── iso-ir-98.c ├── iso-ir-99.c ├── iso646-dk.c ├── iso646-kr.c ├── jis_x0201.c ├── jis_x0208-1983.c ├── jis_x0212-1990.c ├── johab.c ├── koi8-r.c ├── koi8-ru.c ├── koi8-u.c ├── ksx1001.c ├── libapriconv_ccs_modules.dsp ├── mac-ce.c ├── mac-croatian.c ├── mac-cyrillic.c ├── mac-dingbats.c ├── mac-greek.c ├── mac-iceland.c ├── mac-japan.c ├── mac-roman.c ├── mac-romania.c ├── mac-thai.c ├── mac-turkish.c ├── mac-ukraine.c ├── macintosh.c ├── osd_ebcdic_df04_1.c ├── osd_ebcdic_df04_15.c ├── shift_jis.c ├── us-ascii.c ├── windows-1250.c ├── windows-1251.c ├── windows-1252.c ├── windows-1253.c ├── windows-1254.c ├── windows-1255.c ├── windows-1256.c ├── windows-1257.c └── windows-1258.c ├── ces ├── Makefile.in ├── Makefile.win ├── _tbl_simple.c ├── apriconv_ces_modules.dsp ├── charset.aliases ├── euc-jp.c ├── euc-kr.c ├── euc-tw.c ├── gb2312.c ├── iso-10646-ucs-2.c ├── iso-10646-ucs-4.c ├── iso-2022-cn.c ├── iso-2022-jp-2.c ├── iso-2022-jp.c ├── iso-2022-kr.c ├── libapriconv_ces_modules.dsp ├── ucs2-internal.c ├── ucs4-internal.c ├── unicode-1-1-utf-7.c ├── utf-16.c └── utf-8.c ├── configure.in ├── docs └── doxygen.conf ├── include ├── api_version.h └── apr_iconv.h ├── lib ├── Makefile.in ├── api_version.c ├── charset_alias.h ├── iconv.c ├── iconv.h ├── iconv_ccs.c ├── iconv_ces.c ├── iconv_ces_euc.c ├── iconv_ces_iso2022.c ├── iconv_int.c ├── iconv_module.c └── iconv_uc.c ├── libapriconv.dep ├── libapriconv.dsp ├── libapriconv.mak ├── libapriconv.rc └── util ├── Makefile.in ├── iconv.c ├── iconv_stream.c └── iconv_stream.h /AUTHORS: -------------------------------------------------------------------------------- 1 | Konstantin Chuguev 2 | -------------------------------------------------------------------------------- /CHANGES: -------------------------------------------------------------------------------- 1 | -*- coding: utf-8 -*- 2 | Changes with APR-ICONV 1.2.3 3 | 4 | 5 | 6 | Changes with APR-ICONV 1.2.2 7 | 8 | *) Win32: Resolve build issues with modern Visual Studio toolchains. 9 | Specifically changed the handling of precompiled headers; the .obj 10 | file which contains a traceable flavor of the intrinsic functions 11 | is now required. [William Rowe] 12 | 13 | Changes with APR-ICONV 1.2.1 14 | 15 | *) Build schema fixes for win32 including VC8 precompiled header files, 16 | NT and 9x specific builds, and x86_64 P64 model. [William Rowe] 17 | 18 | *) Build schema fixes for unix including default --prefix, vpath builds, 19 | and decorated lib name. [Davi Arnaut, William Rowe, Henry Jen] 20 | 21 | Changes with APR-ICONV 1.2.0 22 | 23 | *) Install 'iconv' utility as bin/apriconv to avoid colliding with 24 | system provided iconv, install public headers to include/apr-1/ 25 | per convention. [William Rowe] 26 | 27 | *) Fixes for Mingw builds and normalize to the APR conventions (e.g. 28 | apriconv-1.so library name). [Kouhei Sutou ] 29 | 30 | *) Fix compiler emits for char <-> 2byte unicode pointer assignments. 31 | [William Rowe] 32 | 33 | *) Correct from_ucs zero width joiner/byte order mark to be injected 34 | only at the *start* of stream (when state is still 0). 35 | PR 24387 [Kohn Emil Dan ] 36 | 37 | *) Fix build on GCC 4.0 38 | [William Barker ] 39 | 40 | Changes with APR-ICONV 1.1.0 41 | 42 | *) Correctly resolve to APR-1.0, never APR-0.9 in ./buildconf 43 | [William Rowe] 44 | 45 | *) APR_ICONV1_PATH distinguishes between our apr-iconv 0.9 and 1.x 46 | flavors (the pool arguments to several internal functions changed 47 | in 1.0, so the loadable charset modules are not binary compatible.) 48 | To maintain APR-iconv 1.0 compatibility, first APR_ICONV1 is used, 49 | if it is set then the older 0.9 flavor APR_ICONV_PATH won't be 50 | searched. apr-iconv 0.9 and 1.0 will only coexist if both the 51 | APR_ICONV1_PATH and APR_ICONV_PATH variables are both set to their 52 | respective charset directories. [William Rowe] 53 | 54 | Changes with APR-ICONV 1.0.2 55 | 56 | *) Fix libapriconv.rc for Win32 builds [William Rowe, Justin Erenkrantz] 57 | 58 | Changes with APR-ICONV 1.0.1 59 | 60 | Changes with APR-ICONV 1.0.0 61 | 62 | *) Add the possiblity of a DESTDIR prefix to Makefile.in to make it 63 | consistent with the behaviour of apr and apr-util. [Graham Leggett] 64 | 65 | Changes with APR-ICONV 0.9.5 66 | 67 | Changes with APR-ICONV 0.9.4 68 | 69 | *) Add -v option to iconv program. [Justin Erenkrantz] 70 | 71 | *) Add api_version.h. [Justin Erenkrantz] 72 | 73 | *) A fourth pass at a build system. [Justin Erenkrantz] 74 | 75 | *) A third pass at a build system. [Justin Erenkrantz] 76 | 77 | Changes with APR-ICONV 0.9.3 78 | 79 | Changes with APR-ICONV 0.9.2 80 | 81 | *) A second pass at a working build system - now builds on linux, 82 | some namespace protection added. 83 | [jean-frederic clere ] 84 | 85 | *) A first blush at a working build system. 86 | [jean-frederic clere ] 87 | 88 | *) First set of changes for APR compatibility (eliminated __inline). 89 | [jean-frederic clere ] 90 | 91 | *) Source moved from the apr library into it's own repository 92 | due to size concerns. Still requires portability overhaul. 93 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Top-level Makefile for APRICONV 3 | # 4 | abs_srcdir=@api_srcdir@ 5 | abs_builddir=@api_builddir@ 6 | VPATH = @srcdir@ 7 | 8 | # bring in rules.mk for standard functionality 9 | @INCLUDE_RULES@ 10 | 11 | SUBDIRS = lib ccs ces util 12 | CLEAN_SUBDIRS = . lib ccs ces util 13 | 14 | TARGET_LIB = libapriconv-1.la 15 | 16 | DISTCLEAN_TARGETS = config.cache config.log config.status 17 | EXTRACLEAN_TARGETS = configure libtool aclocal.m4 18 | 19 | ### install location 20 | prefix=@prefix@ 21 | exec_prefix=@prefix@/bin 22 | lib_prefix=@prefix@/lib 23 | include_prefix=@prefix@/include/@API_INCPATH@ 24 | libdir=@iconv_libdir@ 25 | 26 | API_CPPFLAGS=@API_CPPFLAGS@ 27 | 28 | INSTALL = @INSTALL@ 29 | INSTALL_DATA = @INSTALL_DATA@ 30 | MKINSTALLDIRS=$(abs_srcdir)/build/mkdir.sh 31 | 32 | install: 33 | if [ ! -d $(DESTDIR)$(lib_prefix) ]; then \ 34 | $(MKINSTALLDIRS) $(DESTDIR)$(lib_prefix); \ 35 | fi; 36 | (cd lib; $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(DESTDIR)$(lib_prefix)) 37 | if [ ! -d $(DESTDIR)$(libdir) ]; then \ 38 | $(MKINSTALLDIRS) $(DESTDIR)$(libdir); \ 39 | fi; \ 40 | (cd ccs; for i in *.la; do $(LIBTOOL) --mode=install cp $$i $(DESTDIR)$(libdir); done) 41 | (cd ces; for i in *.la; do $(LIBTOOL) --mode=install cp $$i $(DESTDIR)$(libdir); done) 42 | if [ ! -d $(DESTDIR)$(include_prefix) ]; then \ 43 | $(MKINSTALLDIRS) $(DESTDIR)$(include_prefix); \ 44 | fi; 45 | $(INSTALL_DATA) $(abs_srcdir)/include/api_version.h $(DESTDIR)$(include_prefix) 46 | $(INSTALL_DATA) $(abs_srcdir)/include/apr_iconv.h $(DESTDIR)$(include_prefix) 47 | if [ ! -d $(DESTDIR)$(exec_prefix) ]; then \ 48 | $(MKINSTALLDIRS) $(DESTDIR)$(exec_prefix); \ 49 | fi; \ 50 | (cd util; $(LIBTOOL) --mode=install cp apriconv $(DESTDIR)$(exec_prefix)) 51 | 52 | all: 53 | (cd lib; $(MAKE) CPPFLAGS="$(API_CPPFLAGS) $(CPPFLAGS)") 54 | (cd ccs; $(MAKE)) 55 | (cd ces; $(MAKE)) 56 | (cd util; $(MAKE)) 57 | 58 | docs: 59 | mkdir ./docs 60 | perl $(abs_srcdir)/build/scandoc.pl -i./build/default.pl -p./docs/ ./lib/*.h 61 | 62 | .PHONY: delete-lib 63 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache Portable Runtime ICONV Charset Conversion Library 2 | Copyright (c) 2000-2019 The Apache Software Foundation. 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ICONV - Charset Conversion Library. Version 1.0 2 | ----------------------------------------------- 3 | 4 | This distribution contains the library (libiconv.a and .so) for 5 | conversion between various charsets (character encoding schemes) 6 | and the command line utility (iconv). 7 | 8 | Syntax of the library functions (iconv_open, iconv, iconv_close) 9 | and the utility is described in the man pages. 10 | 11 | Features of the library: 12 | - small size: the actual conversion methods are located 13 | in dynamically loaded shared modules, representing 14 | either a character encoding scheme (CES), or a coded 15 | character set (CCS); 16 | - open module API: adding new modules (both CESs and 17 | CCSs) is easy. Although the API has not been documented, 18 | it is rather simple to be figured out from the sources; 19 | - BSD-style copyright; 20 | - POSIX compliance of iconv_open, iconv and iconv_close 21 | functions; 22 | - support for aliases for charset names via UNIX symbolic 23 | links; 24 | - ISO/IEC 10646 conformance of the internal representation 25 | of characters; conversion is always done in two steps: 26 | (1) a sequence of zero or more bytes from input buffer 27 | coded in the source charset is converted to exactly one 28 | valid UCS-4 character and (2) the UCS-4 character is 29 | converted to a sequence of zero or more bytes in 30 | the target charset to the output buffer; 31 | - standard sources of CCS tables: all C source files of 32 | the tables have been generated by a Perl script from 33 | the Unicode and RFC1345 charset mapping tables before 34 | being included to the package. 35 | 36 | Konstantin Chuguev 37 | 38 | September 2000. 39 | -------------------------------------------------------------------------------- /STATUS: -------------------------------------------------------------------------------- 1 | APACHE PORTABLE RUNTIME APR-ICONV LIBRARY STATUS: -*- coding: utf-8 -*- 2 | Last modified at [$Date$] 3 | 4 | Releases: 5 | 1.2.3 : in maintenance 6 | 1.2.2 : released October 22, 2017 7 | 1.2.1 : released November 26, 2007 8 | 1.2.0 : released June 7, 2007 9 | 1.1.1 : released November 23, 2005 10 | 1.1.0 : not released 11 | 1.0.1 : released November 19, 2004 12 | 1.0.0 : released September 1, 2004 13 | 0.9.7 : released October 11, 2005 14 | 0.9.6 : not released 15 | 0.9.5 : released November 16, 2004 16 | 0.9.4 : released September 26, 2003 17 | 0.9.3 : tagged March 30, 2002 18 | 0.9.2 : released March 22, 2002 (alpha) 19 | 20 | RELEASE SHOWSTOPPERS: 21 | 22 | 23 | RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: 24 | 25 | * Drop modules.c code and replace much functionality with the 26 | apr dso methods, etc. 27 | 28 | Other bugs that need fixing: 29 | 30 | * APR-util ./testall demonstrates that on finalization (when the 31 | users calls with NULL inbuf and their target outbuf) that the 32 | utf-7 converter doesn't exit the shift-state. Not certain that 33 | this is in fact a bug in the code, an unimplemented feature or 34 | a mistaken assumption in the apr-util/test/testxlate.c code. 35 | 36 | Other features that need writing: 37 | 38 | 39 | Documentation that needs writing: 40 | 41 | * API documentation 42 | Status: 43 | 44 | 45 | Available Patches: 46 | 47 | 48 | Open Issues: 49 | -------------------------------------------------------------------------------- /apriconv.dep: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Generated Dependency File, included by apriconv.mak 2 | 3 | .\lib\iconv.c : \ 4 | ".\include\apr_iconv.h"\ 5 | ".\lib\iconv.h"\ 6 | 7 | 8 | .\lib\iconv_ces.c : \ 9 | ".\include\apr_iconv.h"\ 10 | ".\lib\iconv.h"\ 11 | 12 | 13 | .\lib\iconv_ces_euc.c : \ 14 | ".\include\apr_iconv.h"\ 15 | ".\lib\iconv.h"\ 16 | 17 | 18 | .\lib\iconv_ces_iso2022.c : \ 19 | ".\include\apr_iconv.h"\ 20 | ".\lib\iconv.h"\ 21 | 22 | 23 | .\lib\iconv_int.c : \ 24 | ".\include\apr_iconv.h"\ 25 | ".\lib\iconv.h"\ 26 | 27 | 28 | .\lib\iconv_module.c : \ 29 | ".\include\api_version.h"\ 30 | ".\include\apr_iconv.h"\ 31 | ".\lib\charset_alias.h"\ 32 | ".\lib\iconv.h"\ 33 | 34 | 35 | .\lib\iconv_uc.c : \ 36 | ".\include\apr_iconv.h"\ 37 | ".\lib\iconv.h"\ 38 | 39 | -------------------------------------------------------------------------------- /build/apr-iconv.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl custom autoconf rules for APRICONV 3 | dnl 4 | 5 | dnl 6 | dnl API_FIND_APR: figure out where APR is located 7 | dnl 8 | AC_DEFUN(API_FIND_APR,[ 9 | 10 | dnl use the find_apr.m4 script to locate APR. sets apr_found and apr_config 11 | APR_FIND_APR(,,,[1]) 12 | if test "$apr_found" = "no"; then 13 | AC_MSG_ERROR(APR could not be located. Please use the --with-apr option.) 14 | fi 15 | 16 | APR_BUILD_DIR="`$apr_config --installbuilddir`" 17 | 18 | dnl make APR_BUILD_DIR an absolute directory (we'll need it in the 19 | dnl sub-projects in some cases) 20 | APR_BUILD_DIR="`cd $APR_BUILD_DIR && pwd`" 21 | 22 | APR_INCLUDES="`$apr_config --includes`" 23 | APR_LIBS="`$apr_config --link-libtool --libs`" 24 | APR_SO_EXT="`$apr_config --apr-so-ext`" 25 | APR_LIB_TARGET="`$apr_config --apr-lib-target`" 26 | 27 | AC_SUBST(APR_INCLUDES) 28 | AC_SUBST(APR_LIBS) 29 | AC_SUBST(APR_SO_EXT) 30 | AC_SUBST(APR_LIB_TARGET) 31 | 32 | dnl ### would be nice to obsolete these 33 | APR_SOURCE_DIR="`$apr_config --srcdir`" 34 | AC_SUBST(APR_BUILD_DIR) 35 | AC_SUBST(APR_SOURCE_DIR) 36 | ]) 37 | -------------------------------------------------------------------------------- /build/gen_aliases.awk: -------------------------------------------------------------------------------- 1 | # This file generates C code for a character set alias lookup table 2 | # from the ccs/charset.aliases and ces/charset.aliases files. 3 | 4 | # Valid alias definitions must have at least two fields 5 | NF > 1 { 6 | target = unescape(tolower($1)); 7 | for (n = 2; n <= NF; ++n) 8 | aliases[unescape(tolower($n))] = target; 9 | } 10 | 11 | # Ignore all other lines 12 | { next } 13 | 14 | # Now generate the sorted alias list and lookup code 15 | END { 16 | # We'll have to sort the alias list, so that we can later use 17 | # bsearch to find an alias. 18 | alias_count = 0; 19 | for (name in aliases) 20 | alias_names[alias_count++] = name; 21 | sort(alias_names, alias_count); 22 | 23 | # Right, now generate the alias array and lookup code 24 | print "/* GENERATED CODE -- DO NOT EDIT -*- C -*-"; 25 | print " * Use the following command to regenerate this file:"; 26 | print " * awk -f ../build/gen_aliases.awk \\"; 27 | print " * ../ccs/charset.aliases \\"; 28 | print " * ../ces/charset.aliases > charset_alias.h"; 29 | print " */"; 30 | print "#ifndef API_HAVE_CHARSET_ALIAS_TABLE"; 31 | print "#define API_HAVE_CHARSET_ALIAS_TABLE"; 32 | print ""; 33 | print "#include "; 34 | print "#include "; 35 | print ""; 36 | print "/* This is a sorted table of alias -> true name mappings. */"; 37 | print "static struct charset_alias {"; 38 | print " const char *name;"; 39 | print " const char *target;"; 40 | print "} const charset_alias_list[] = {"; 41 | 42 | for (i = 0; i < alias_count; ++i) 43 | print " {\"" alias_names[i] "\", \"" aliases[alias_names[i]] "\"},"; 44 | 45 | print " {NULL, NULL} };"; 46 | print ""; 47 | print "static const size_t charset_alias_count ="; 48 | print " sizeof(charset_alias_list)/sizeof(charset_alias_list[0]) - 1;" 49 | print ""; 50 | 51 | print "/* Compare two aliases. */"; 52 | print "static int charset_alias_compare (const void *u, const void *v)"; 53 | print "{"; 54 | print " const struct charset_alias *const a = u;"; 55 | print " const struct charset_alias *const b = v;"; 56 | print " return strcmp(a->name, b->name);"; 57 | print "}"; 58 | print ""; 59 | 60 | print "/* Look up an alias in the sorted table and return its name,"; 61 | print " or NULL if it's not in the table. */"; 62 | print "static const char *charset_alias_find (const char *name)"; 63 | print "{"; 64 | print " struct charset_alias key;"; 65 | print " struct charset_alias *alias;"; 66 | print "#if 'A' == '\\xC1' /* if EBCDIC host */"; 67 | print " /* The table is sorted in ASCII collation order, not in EBCDIC order."; 68 | print " * At the first access, we sort it automatically"; 69 | print " * Criterion for the 1st time initialization is the fact that the"; 70 | print " * 1st name in the list starts with a digit (in ASCII, numbers"; 71 | print " * have a lower ordinal value than alphabetic characters; while"; 72 | print " * in EBCDIC, their ordinal value is higher)"; 73 | print " */"; 74 | print " if (isdigit(charset_alias_list[0].name[0])) {"; 75 | print " qsort((void *)charset_alias_list, charset_alias_count,"; 76 | print " sizeof(charset_alias_list[0]),"; 77 | print " charset_alias_compare);"; 78 | print " }"; 79 | #endif 80 | print " key.name = name;"; 81 | print " alias = bsearch(&key, charset_alias_list, charset_alias_count,"; 82 | print " sizeof(charset_alias_list[0]),"; 83 | print " charset_alias_compare);"; 84 | print " if (alias)"; 85 | print " return alias->target;"; 86 | print " else"; 87 | print " return NULL;" 88 | print "}"; 89 | print ""; 90 | 91 | print "#endif /* API_HAVE_CHARSET_ALIAS_TABLE */"; 92 | } 93 | 94 | # Remove shell escapes from charset names 95 | function unescape(name) { 96 | gsub(/\\\(/, "(", name); 97 | gsub(/\\\)/, ")", name); 98 | return name; 99 | } 100 | 101 | # Yes, bubblesort. So what? 102 | function sort(list, len) { 103 | for (i = len; i > 1; --i) { 104 | swapped = 0; 105 | for (j = 1; j < i; ++j) { 106 | if (list[j-1] > list[j]) { 107 | temp = list[j]; 108 | list[j] = list[j-1]; 109 | list[j-1] = temp; 110 | swapped = 1; 111 | } 112 | } 113 | if (!swapped) 114 | break; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /build/preapriconv.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="preapriconv" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) External Target" 0x0106 6 | 7 | CFG=preapriconv - Win32 Release 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "preapriconv.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "preapriconv.mak" CFG="preapriconv - Win32 Release" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "preapriconv - Win32 Release" (based on "Win32 (x86) External Target") 21 | !MESSAGE "preapriconv - Win32 Debug" (based on "Win32 (x86) External Target") 22 | !MESSAGE "preapriconv - x64 Release" (based on "Win32 (x86) External Target") 23 | !MESSAGE "preapriconv - x64 Debug" (based on "Win32 (x86) External Target") 24 | !MESSAGE 25 | 26 | # Begin Project 27 | # PROP AllowPerConfigDependencies 0 28 | # PROP Scc_ProjName "" 29 | # PROP Scc_LocalPath "" 30 | 31 | !IF "$(CFG)" == "preapriconv - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "" 36 | # PROP BASE Intermediate_Dir "" 37 | # PROP BASE Cmd_Line "NMAKE /nologo /f NUL" 38 | # PROP BASE Rebuild_Opt "/a" 39 | # PROP BASE Target_File "preapriconv.exe" 40 | # PROP BASE Bsc_Name "preapriconv.bsc" 41 | # PROP BASE Target_Dir "" 42 | # PROP Use_MFC 0 43 | # PROP Use_Debug_Libraries 0 44 | # PROP Output_Dir "" 45 | # PROP Intermediate_Dir "" 46 | # PROP Cmd_Line "NMAKE /nologo /f NUL" 47 | # PROP Rebuild_Opt "/a" 48 | # PROP Bsc_Name "" 49 | # PROP Target_Dir "" 50 | 51 | !ELSEIF "$(CFG)" == "preapriconv - Win32 Debug" 52 | 53 | # PROP BASE Use_MFC 0 54 | # PROP BASE Use_Debug_Libraries 1 55 | # PROP BASE Output_Dir "" 56 | # PROP BASE Intermediate_Dir "" 57 | # PROP BASE Cmd_Line "NMAKE /nologo /f NUL" 58 | # PROP BASE Rebuild_Opt "/a" 59 | # PROP BASE Target_File "preapriconv.exe" 60 | # PROP BASE Bsc_Name "preapriconv.bsc" 61 | # PROP BASE Target_Dir "" 62 | # PROP Use_MFC 0 63 | # PROP Use_Debug_Libraries 1 64 | # PROP Output_Dir "" 65 | # PROP Intermediate_Dir "" 66 | # PROP Cmd_Line "NMAKE /nologo /f NUL" 67 | # PROP Rebuild_Opt "/a" 68 | # PROP Bsc_Name "" 69 | # PROP Target_Dir "" 70 | 71 | !ELSEIF "$(CFG)" == "preapriconv - x64 Release" 72 | 73 | # PROP BASE Use_MFC 0 74 | # PROP BASE Use_Debug_Libraries 0 75 | # PROP BASE Output_Dir "" 76 | # PROP BASE Intermediate_Dir "" 77 | # PROP BASE Cmd_Line "NMAKE /nologo /f NUL" 78 | # PROP BASE Rebuild_Opt "/a" 79 | # PROP BASE Target_File "preapriconv.exe" 80 | # PROP BASE Bsc_Name "preapriconv.bsc" 81 | # PROP BASE Target_Dir "" 82 | # PROP Use_MFC 0 83 | # PROP Use_Debug_Libraries 0 84 | # PROP Output_Dir "" 85 | # PROP Intermediate_Dir "" 86 | # PROP Cmd_Line "NMAKE /nologo /f NUL" 87 | # PROP Rebuild_Opt "/a" 88 | # PROP Bsc_Name "" 89 | # PROP Target_Dir "" 90 | 91 | !ELSEIF "$(CFG)" == "preapriconv - x64 Debug" 92 | 93 | # PROP BASE Use_MFC 0 94 | # PROP BASE Use_Debug_Libraries 1 95 | # PROP BASE Output_Dir "" 96 | # PROP BASE Intermediate_Dir "" 97 | # PROP BASE Cmd_Line "NMAKE /nologo /f NUL" 98 | # PROP BASE Rebuild_Opt "/a" 99 | # PROP BASE Target_File "preapriconv.exe" 100 | # PROP BASE Bsc_Name "preapriconv.bsc" 101 | # PROP BASE Target_Dir "" 102 | # PROP Use_MFC 0 103 | # PROP Use_Debug_Libraries 1 104 | # PROP Output_Dir "" 105 | # PROP Intermediate_Dir "" 106 | # PROP Cmd_Line "NMAKE /nologo /f NUL" 107 | # PROP Rebuild_Opt "/a" 108 | # PROP Bsc_Name "" 109 | # PROP Target_Dir "" 110 | 111 | !ENDIF 112 | 113 | # Begin Target 114 | 115 | # Name "preapriconv - Win32 Release" 116 | # Name "preapriconv - Win32 Debug" 117 | # Name "preapriconv - x64 Release" 118 | # Name "preapriconv - x64 Debug" 119 | 120 | !IF "$(CFG)" == "preapriconv - Win32 Release" 121 | 122 | !ELSEIF "$(CFG)" == "preapriconv - Win32 Debug" 123 | 124 | !ELSEIF "$(CFG)" == "preapriconv - x64 Release" 125 | 126 | !ELSEIF "$(CFG)" == "preapriconv - x64 Debug" 127 | 128 | !ENDIF 129 | 130 | # End Target 131 | # End Project 132 | -------------------------------------------------------------------------------- /buildconf: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Default place to look for apr source. Can be overridden with 4 | # --with-apr=[directory] 5 | apr_src_dir=../apr 6 | 7 | while test $# -gt 0 8 | do 9 | # Normalize 10 | case "$1" in 11 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 12 | *) optarg= ;; 13 | esac 14 | 15 | case "$1" in 16 | --with-apr=*) 17 | apr_src_dir=$optarg 18 | ;; 19 | esac 20 | 21 | shift 22 | done 23 | 24 | if test -d "$apr_src_dir" 25 | then 26 | echo "" 27 | echo "Looking for apr source in $apr_src_dir" 28 | else 29 | echo "" 30 | echo "Problem finding apr source in $apr_src_dir." 31 | echo "Use:" 32 | echo " --with-apr=[directory]" 33 | exit 1 34 | fi 35 | 36 | # Remove some files, then copy them from apr source tree 37 | rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \ 38 | build/config.guess build/config.sub build/mkdir.sh \ 39 | build/make_exports.awk build/make_var_export.awk \ 40 | build/get-version.sh 41 | cp $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \ 42 | $apr_src_dir/build/install.sh $apr_src_dir/build/config.guess \ 43 | $apr_src_dir/build/config.sub $apr_src_dir/build/mkdir.sh \ 44 | $apr_src_dir/build/make_exports.awk $apr_src_dir/build/make_var_export.awk \ 45 | $apr_src_dir/build/get-version.sh \ 46 | build 47 | 48 | # Remove aclocal.m4 as it'll break some builds... 49 | rm -rf aclocal.m4 autom4te*.cache 50 | 51 | # 52 | # Generate the autoconf header and ./configure 53 | # 54 | echo "Creating lib/apr_iconv_private.h ..." 55 | ${AUTOHEADER:-autoheader} 56 | 57 | echo "Creating configure ..." 58 | ### do some work to toss config.cache? 59 | if ${AUTOCONF:-autoconf}; then 60 | : 61 | else 62 | echo "autoconf failed" 63 | exit 1 64 | fi 65 | -------------------------------------------------------------------------------- /ccs/Makefile.in: -------------------------------------------------------------------------------- 1 | VPATH = @srcdir@ 2 | INCLUDES = @API_INCLUDES@ @APR_INCLUDES@ 3 | 4 | CHARSETS_ISO8859 = iso-8859-1.la iso-8859-2.la iso-8859-4.la iso-8859-5.la \ 5 | iso-8859-15.la 6 | CHARSETS_PC = cp775.la cp850.la cp852.la cp855.la cp866.la 7 | CHARSETS_KOI = koi8-r.la koi8-u.la 8 | CHARSETS_SB = $(CHARSETS_ISO8859) $(CHARSETS_PC) $(CHARSETS_CJK) \ 9 | $(CHARSETS_KOI) us-ascii.la 10 | CHARSETS_CJK = big5.la cns11643-plane1.la cns11643-plane2.la \ 11 | cns11643-plane14.la gb_2312-80.la jis_x0201.la \ 12 | jis_x0208-1983.la jis_x0212-1990.la ksx1001.la shift_jis.la 13 | CHARSETS_ALL = ${CHARSETS_SB} ${CHARSETS_CJK} 14 | EXTRA_ISO8859 = iso-8859-3.la iso-8859-6.la iso-8859-7.la iso-8859-8.la \ 15 | iso-8859-9.la iso-8859-10.la iso-8859-13.la iso-8859-14.la 16 | EXTRA_KOI = koi8-ru.la 17 | EXTRA_MISC = gb12345.la johab.la adobe-stdenc.la adobe-symbol.la \ 18 | adobe-zdingbats.la mac-ce.la mac-croatian.la mac-cyrillic.la \ 19 | mac-dingbats.la mac-greek.la mac-iceland.la mac-japan.la \ 20 | mac-roman.la mac-romania.la mac-thai.la mac-turkish.la \ 21 | mac-ukraine.la 22 | EXTRA_PC = cp424.la cp500.la cp856.la cp1006.la cp437.la cp737.la cp857.la \ 23 | cp860.la cp861.la cp862.la cp863.la cp864.la cp865.la cp869.la \ 24 | cp874.la cp932.la cp936.la cp949.la cp950.la \ 25 | windows-1250.la windows-1251.la windows-1252.la windows-1253.la \ 26 | windows-1254.la windows-1255.la windows-1256.la windows-1257.la \ 27 | windows-1258.la cp037.la cp875.la cp1026.la \ 28 | cp10000.la cp10006.la cp10007.la cp10029.la cp10079.la cp10081.la 29 | EXTRA_ALL = ${EXTRA_ISO8859} ${EXTRA_KOI} ${EXTRA_MISC} ${EXTRA_PC} 30 | RFC1345_PC = cp851.la cp868.la cp038.la cp273.la cp274.la cp275.la cp277.la \ 31 | cp278.la cp280.la cp281.la cp284.la cp285.la cp290.la cp297.la \ 32 | cp420.la cp423.la cp870.la cp871.la cp880.la cp891.la \ 33 | cp903.la cp904.la cp905.la cp918.la 34 | RFC1345_EBCDIC = ebcdic-at-de.la ebcdic-at-de-a.la ebcdic-ca-fr.la \ 35 | ebcdic-dk-no.la ebcdic-dk-no-a.la ebcdic-es.la ebcdic-es-a.la \ 36 | ebcdic-es-s.la ebcdic-fi-se.la ebcdic-fi-se-a.la ebcdic-fr.la \ 37 | ebcdic-it.la ebcdic-pt.la ebcdic-uk.la ebcdic-us.la \ 38 | osd_ebcdic_df04_1.la osd_ebcdic_df04_15.la 39 | RFC1345_IR = iso-ir-2.la iso-ir-4.la iso-ir-8-1.la iso-ir-8-2.la \ 40 | iso-ir-9-1.la iso-ir-9-2.la iso-ir-10.la iso-ir-11.la \ 41 | iso-ir-13.la iso-ir-14.la iso-ir-15.la iso-ir-16.la \ 42 | iso-ir-17.la iso-ir-18.la iso-ir-19.la iso-ir-21.la \ 43 | iso-ir-25.la iso-ir-27.la iso-ir-37.la iso-ir-47.la \ 44 | iso-ir-49.la iso-ir-50.la iso-ir-51.la iso-ir-54.la \ 45 | iso-ir-55.la iso-ir-57.la iso-ir-60.la iso-ir-61.la \ 46 | iso-ir-69.la iso-ir-70.la iso-ir-84.la iso-ir-85.la \ 47 | iso-ir-86.la iso-ir-88.la iso-ir-89.la iso-ir-90.la \ 48 | iso-ir-91.la iso-ir-92.la iso-ir-93.la iso-ir-94.la \ 49 | iso-ir-95.la iso-ir-96.la iso-ir-98.la iso-ir-99.la \ 50 | iso-ir-102.la iso-ir-103.la iso-ir-111.la iso-ir-121.la \ 51 | iso-ir-122.la iso-ir-123.la iso-ir-128.la iso-ir-139.la \ 52 | iso-ir-141.la iso-ir-142.la iso-ir-143.la iso-ir-146.la \ 53 | iso-ir-147.la iso-ir-150.la iso-ir-151.la iso-ir-152.la \ 54 | iso-ir-153.la iso-ir-154.la iso-ir-155.la iso-ir-158.la 55 | RFC1345_MISC = dec-mcs.la hp-roman8.la iso646-dk.la iso646-kr.la macintosh.la 56 | RFC1345_ALL = ${RFC1345_PC} ${RFC1345_EBCDIC} ${RFC1345_IR} ${RFC1345_MISC} 57 | 58 | TARGETS = ${CHARSETS_ALL} ${EXTRA_ALL} ${RFC1345_ALL} 59 | 60 | # bring in rules.mk for standard functionality 61 | @INCLUDE_RULES@ 62 | 63 | .SUFFIXES: 64 | .SUFFIXES: .c .lo .o .la 65 | 66 | .lo.la: 67 | $(LIBTOOL) --mode=link $(COMPILE) -module -avoid-version -rpath @iconv_libdir@ $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $< 68 | -------------------------------------------------------------------------------- /ccs/cp891.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 17 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 36 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 53 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "cp891", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/cp903.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 17 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 36 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 53 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "cp903", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-102.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x0023, 0x00A4, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x005B, 0xFFFE, 0x005D, 0xFFFE, 0x005F, 17 | 0xFFFE, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0x007C, 0xFFFE, 0xFFFE, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0x0023, 0xFFFE, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0x005B, 0xFFFE, 0x005D, 0xFFFE, 0x005F, 36 | 0xFFFE, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0x007C, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x0024, 0xFFFE, 0xFFFE, 0xFFFE, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 53 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-102", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-11.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x0023, 0x00A4, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x00C9, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x00C4, 0x00D6, 0x00C5, 0x00DC, 0x005F, 17 | 0x00E9, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x00E4, 0x00F6, 0x00E5, 0x00FC, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0x0023, 0xFFFE, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0xFFFE, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005F, 36 | 0xFFFE, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x0024, 0xFFFE, 0xFFFE, 0xFFFE, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005B, 0x005D, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0x0040, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005C, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005E, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007B, 0x007D, 0xFFFE, 0xFFFE, 53 | 0xFFFE, 0x0060, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007C, 0xFFFE, 55 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007E, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-11", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-121.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x00E0, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x00E2, 0x00E7, 0x00EA, 0x00EE, 0x005F, 17 | 0x00F4, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x00E9, 0x00F9, 0x00E8, 0x00FB, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0xFFFE, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005F, 36 | 0xFFFE, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0x0040, 0xFFFE, 0x005B, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005C, 53 | 0x007D, 0x007B, 0x005D, 0xFFFE, 0xFFFE, 0xFFFE, 0x005E, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x0060, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0x007C, 0xFFFE, 0x007E, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-121", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-122.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x00E0, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x00E2, 0x00E7, 0x00EA, 0x00C9, 0x005F, 17 | 0x00F4, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x00E9, 0x00F9, 0x00E8, 0x00FB, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0xFFFE, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005F, 36 | 0xFFFE, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0x005E, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0x0040, 0xFFFE, 0x005B, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005C, 53 | 0x007D, 0x007B, 0x005D, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x0060, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0x007C, 0xFFFE, 0x007E, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-122", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-15.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x00A3, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x00A7, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x00B0, 0x00E7, 0x00E9, 0x005E, 0x005F, 17 | 0x00F9, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x00E0, 0x00F2, 0x00E8, 0x00EC, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0xFFFE, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0xFFFE, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0xFFFE, 0xFFFE, 0xFFFE, 0x005E, 0x005F, 36 | 0xFFFE, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0x0023, 0xFFFE, 0xFFFE, 0xFFFE, 0x0040, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0x005B, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0x007B, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005C, 53 | 0x007D, 0x005D, 0xFFFE, 0xFFFE, 0x007E, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0x007C, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0x0060, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-15", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-151.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x0023, 0x00A4, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x00A1, 0x00D1, 0x005D, 0x00BF, 0x005F, 17 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x00B4, 0x00F1, 0x005B, 0x00A8, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0x0023, 0xFFFE, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0x007D, 0xFFFE, 0x005D, 0xFFFE, 0x005F, 36 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0x005B, 0xFFFE, 0xFFFE, 0x0024, 0xFFFE, 0xFFFE, 0xFFFE, 45 | 0x007E, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007B, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005E, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0x005C, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 53 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0x007C, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-151", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-16.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x00A7, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x00C3, 0x00C7, 0x00D5, 0x005E, 0x005F, 17 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x00E3, 0x00E7, 0x00F5, 0x00B0, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0xFFFE, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0xFFFE, 0xFFFE, 0xFFFE, 0x005E, 0x005F, 36 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x0040, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0x007E, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0x005B, 0xFFFE, 0xFFFE, 0xFFFE, 0x005C, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005D, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0x007B, 0xFFFE, 0xFFFE, 0xFFFE, 0x007C, 53 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007D, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-16", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-17.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x00A3, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x00A7, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x00A1, 0x00D1, 0x00BF, 0x005E, 0x005F, 17 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x00B0, 0x00F1, 0x00E7, 0x007E, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0xFFFE, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0xFFFE, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0xFFFE, 0xFFFE, 0xFFFE, 0x005E, 0x005F, 36 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0xFFFE, 0xFFFE, 0x007E, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0x005B, 0xFFFE, 0x0023, 0xFFFE, 0xFFFE, 0xFFFE, 0x0040, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0x007B, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005D, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0x005C, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007D, 53 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0x007C, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-17", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-21.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x00A7, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x00C4, 0x00D6, 0x00DC, 0x005E, 0x005F, 17 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x00E4, 0x00F6, 0x00FC, 0x00DF, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0xFFFE, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0xFFFE, 0xFFFE, 0xFFFE, 0x005E, 0x005F, 36 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x0040, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005B, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005C, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005D, 0xFFFE, 0xFFFE, 0x007E, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007B, 0xFFFE, 0xFFFE, 0xFFFE, 53 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007C, 0xFFFE, 55 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007D, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-21", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-25.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x00A3, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x00E0, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x00B0, 0x00E7, 0x00A7, 0x005E, 0x005F, 17 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x00E9, 0x00F9, 0x00E8, 0x00A8, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0xFFFE, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0xFFFE, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0xFFFE, 0xFFFE, 0xFFFE, 0x005E, 0x005F, 36 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0x0023, 0xFFFE, 0xFFFE, 0xFFFE, 0x005D, 45 | 0x007E, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0x005B, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0x0040, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005C, 53 | 0x007D, 0x007B, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0x007C, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-25", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-49.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0xFFFE, 0xFFFE, 0xFFFE, 0x0024, 0x0025, 0xFFFE, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0xFFFE, 13 | 0xFFFE, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x005B, 0xFFFE, 0x005D, 0xFFFE, 0xFFFE, 17 | 0xFFFE, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0x007C, 0xFFFE, 0xFFFE, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0xFFFE, 0xFFFE, 0xFFFE, 0x0024, 0x0025, 0xFFFE, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0xFFFE, 32 | 0xFFFE, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0x005B, 0xFFFE, 0x005D, 0xFFFE, 0xFFFE, 36 | 0xFFFE, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0x007C, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 53 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-49", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-61.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x00B6, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x00C6, 0x00D8, 0x00C5, 0x005E, 0x005F, 17 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x00E6, 0x00F8, 0x00E5, 0x007C, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0xFFFE, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0xFFFE, 0xFFFE, 0xFFFE, 0x005E, 0x005F, 36 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0x007E, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x0023, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005D, 0x005B, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0x005C, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007D, 0x007B, 0xFFFE, 53 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0x007C, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-61", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-69.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x00A3, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x00E0, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x00B0, 0x00E7, 0x00A7, 0x005E, 0x005F, 17 | 0x00B5, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x00E9, 0x00F9, 0x00E8, 0x00A8, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0xFFFE, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0xFFFE, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0xFFFE, 0xFFFE, 0xFFFE, 0x005E, 0x005F, 36 | 0xFFFE, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0x0023, 0xFFFE, 0xFFFE, 0xFFFE, 0x005D, 45 | 0x007E, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0x005B, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x0060, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0x0040, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x005C, 53 | 0x007D, 0x007B, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0x007C, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-69", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/iso-ir-93.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0xFFFE, 0xFFFE, 0x00A3, 0x00A4, 0x005C, 0xFFFE, 0x00A7, 10 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 11 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 12 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 13 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 14 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 15 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 16 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 17 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 18 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 19 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 20 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 29 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 30 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 31 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 32 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 33 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 34 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 35 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x0025, 0xFFFE, 0xFFFE, 0xFFFE, 36 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 37 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 38 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 39 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0x0023, 0x0024, 0xFFFE, 0xFFFE, 0x0027, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 53 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "iso-ir-93", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ccs/mac-ukraine.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 6 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 7 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 8 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 9 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 10 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 11 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 12 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 13 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 14 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 15 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 16 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 17 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 18 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 19 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 20 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 21 | } }; 22 | 23 | static const iconv_ccs_convtable_16bit from_ucs = { { 24 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 25 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 26 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 27 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 28 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 29 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 30 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 31 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 32 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 33 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 34 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 35 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 36 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 37 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 38 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 39 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 41 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 42 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 43 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 44 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 45 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 46 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 47 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 48 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 49 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 50 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 51 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 52 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 54 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 55 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 56 | } }; 57 | 58 | #define NBITS 7 59 | 60 | static ucs2_t convert_from_ucs(ucs2_t ch) 61 | { 62 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 63 | } 64 | 65 | static ucs2_t convert_to_ucs(ucs2_t ch) 66 | { 67 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 68 | } 69 | 70 | static const char * const names[] = { 71 | "mac-ukraine", NULL 72 | }; 73 | 74 | static const struct iconv_ccs_desc iconv_ccs_desc = { 75 | names, NBITS, 76 | (const iconv_ccs_convtable *)&from_ucs, 77 | (const iconv_ccs_convtable *)&to_ucs, 78 | convert_from_ucs, convert_to_ucs, 79 | }; 80 | 81 | struct iconv_module_desc iconv_module = { 82 | ICMOD_UC_CCS, 83 | apr_iconv_mod_noevent, 84 | NULL, 85 | &iconv_ccs_desc 86 | }; 87 | -------------------------------------------------------------------------------- /ccs/us-ascii.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | static const iconv_ccs_convtable_7bit to_ucs = { { 5 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 6 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 7 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 8 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 9 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 10 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 11 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 12 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 13 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 14 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 15 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 16 | 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 17 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 18 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 19 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 20 | 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F 21 | } }; 22 | 23 | static const iconv_ccs_convtable_8bit from_ucs_00 = { { 24 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 25 | 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 26 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 27 | 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 28 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 29 | 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 30 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 31 | 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 32 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 33 | 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 34 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 35 | 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 36 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 37 | 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 38 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 39 | 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 40 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 41 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 42 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 43 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 44 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 45 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 46 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 47 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 48 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 49 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 50 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 51 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 52 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 53 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 54 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 55 | 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE 56 | } }; 57 | 58 | static const iconv_ccs_convtable_16bit from_ucs = { { 59 | &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 65 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 68 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 69 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 75 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 76 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 77 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 78 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 79 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 81 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 82 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 83 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 84 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 85 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 86 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 87 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 91 | } }; 92 | 93 | #define NBITS 7 94 | 95 | static ucs2_t convert_from_ucs(ucs2_t ch) 96 | { 97 | return iconv_ccs_convert_16bit((const iconv_ccs_convtable *)&from_ucs, ch); 98 | } 99 | 100 | static ucs2_t convert_to_ucs(ucs2_t ch) 101 | { 102 | return iconv_ccs_convert_7bit((const iconv_ccs_convtable *)&to_ucs, ch); 103 | } 104 | 105 | static const char * const names[] = { 106 | "us-ascii", NULL 107 | }; 108 | 109 | static const struct iconv_ccs_desc iconv_ccs_desc = { 110 | names, NBITS, 111 | (const iconv_ccs_convtable *)&from_ucs, 112 | (const iconv_ccs_convtable *)&to_ucs, 113 | convert_from_ucs, convert_to_ucs, 114 | }; 115 | 116 | struct iconv_module_desc iconv_module = { 117 | ICMOD_UC_CCS, 118 | apr_iconv_mod_noevent, 119 | NULL, 120 | &iconv_ccs_desc 121 | }; 122 | -------------------------------------------------------------------------------- /ces/Makefile.in: -------------------------------------------------------------------------------- 1 | VPATH = @srcdir@ 2 | INCLUDES = @API_INCLUDES@ @APR_INCLUDES@ 3 | 4 | MODULES_CORE= _tbl_simple.la euc-jp.la euc-kr.la euc-tw.la gb2312.la \ 5 | iso-10646-ucs-2.la iso-10646-ucs-4.la \ 6 | ucs2-internal.la ucs4-internal.la utf-8.la utf-16.la 7 | 8 | MODULES_EXTRA = unicode-1-1-utf-7.la iso-2022-cn.la iso-2022-jp.la \ 9 | iso-2022-jp-2.la iso-2022-kr.la 10 | 11 | 12 | TARGETS = ${MODULES_CORE} ${MODULES_EXTRA} 13 | 14 | # bring in rules.mk for standard functionality 15 | @INCLUDE_RULES@ 16 | 17 | .SUFFIXES: 18 | .SUFFIXES: .c .lo .o .la 19 | 20 | .lo.la: 21 | $(LIBTOOL) --mode=link $(COMPILE) -module -avoid-version -rpath @iconv_libdir@ $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $< 22 | -------------------------------------------------------------------------------- /ces/Makefile.win: -------------------------------------------------------------------------------- 1 | ALL_TARGETS = \ 2 | $(OUTPUT_DIR)\_tbl_simple.so \ 3 | $(OUTPUT_DIR)\euc-jp.so \ 4 | $(OUTPUT_DIR)\euc-kr.so \ 5 | $(OUTPUT_DIR)\euc-tw.so \ 6 | $(OUTPUT_DIR)\gb2312.so \ 7 | $(OUTPUT_DIR)\iso-10646-ucs-2.so \ 8 | $(OUTPUT_DIR)\iso-10646-ucs-4.so \ 9 | $(OUTPUT_DIR)\iso-2022-cn.so \ 10 | $(OUTPUT_DIR)\iso-2022-jp-2.so \ 11 | $(OUTPUT_DIR)\iso-2022-jp.so \ 12 | $(OUTPUT_DIR)\iso-2022-kr.so \ 13 | $(OUTPUT_DIR)\ucs2-internal.so \ 14 | $(OUTPUT_DIR)\ucs4-internal.so \ 15 | $(OUTPUT_DIR)\unicode-1-1-utf-7.so \ 16 | $(OUTPUT_DIR)\utf-16.so \ 17 | $(OUTPUT_DIR)\utf-8.so 18 | 19 | REBASE_TOP = 0x6EE50000 20 | MODRES=$(OUTPUT_DIR)\cesiconv 21 | 22 | !INCLUDE ../build/modules.mk.win 23 | -------------------------------------------------------------------------------- /ces/charset.aliases: -------------------------------------------------------------------------------- 1 | iso-2022-jp csISO2022JP 2 | iso-2022-jp-2 csISO2022JP2 3 | unicode-1-1-utf-7 utf-7 4 | -------------------------------------------------------------------------------- /ces/euc-jp.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "euc-jp", 38 | "Extended_UNIX_Code_Packed_Format_for_Japanese", 39 | "csEUCPkdFmtJapanese", 40 | NULL 41 | }; 42 | 43 | static const char * const * 44 | euc_names(struct iconv_ces *ces) 45 | { 46 | return names; 47 | } 48 | 49 | static struct iconv_ces_euc_ccs ccsattr[4] = { 50 | {"", 0}, 51 | {"", 0}, 52 | {"\x8e", 1}, 53 | {"\x8f", 1} 54 | }; 55 | 56 | static const struct iconv_module_depend iconv_module_depend[] = { 57 | {ICMOD_UC_CCS, "us-ascii", ccsattr + 0}, 58 | {ICMOD_UC_CCS, "jis_x0208-1983", ccsattr + 1}, 59 | {ICMOD_UC_CCS, "jis_x0201", ccsattr + 2}, 60 | {ICMOD_UC_CCS, "jis_x0212-1990", ccsattr + 3}, 61 | END_ICONV_MODULE_DEPEND 62 | }; 63 | 64 | static const struct iconv_ces_desc iconv_ces_desc = { 65 | apr_iconv_euc_open, 66 | apr_iconv_euc_close, 67 | apr_iconv_ces_no_func, 68 | euc_names, 69 | apr_iconv_ces_nbits8, 70 | apr_iconv_ces_zero, 71 | apr_iconv_euc_convert_from_ucs, 72 | apr_iconv_euc_convert_to_ucs, 73 | }; 74 | 75 | struct iconv_module_desc iconv_module = { 76 | ICMOD_UC_CES, 77 | apr_iconv_mod_noevent, 78 | iconv_module_depend, 79 | &iconv_ces_desc 80 | }; 81 | -------------------------------------------------------------------------------- /ces/euc-kr.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "euc-kr", "csEUCKR", NULL 38 | }; 39 | 40 | static const char * const * 41 | euc_names(struct iconv_ces *ces) 42 | { 43 | return names; 44 | } 45 | 46 | static struct iconv_ces_euc_ccs ccsattr[2] = { 47 | {"", 0}, 48 | {"", 0} 49 | }; 50 | 51 | static const struct iconv_module_depend iconv_module_depend[] = { 52 | {ICMOD_UC_CCS, "us-ascii", ccsattr + 0}, 53 | {ICMOD_UC_CCS, "ksx1001", ccsattr + 1}, 54 | END_ICONV_MODULE_DEPEND 55 | }; 56 | 57 | static const struct iconv_ces_desc iconv_ces_desc = { 58 | apr_iconv_euc_open, 59 | apr_iconv_euc_close, 60 | apr_iconv_ces_no_func, 61 | euc_names, 62 | apr_iconv_ces_nbits8, 63 | apr_iconv_ces_zero, 64 | apr_iconv_euc_convert_from_ucs, 65 | apr_iconv_euc_convert_to_ucs, 66 | }; 67 | 68 | struct iconv_module_desc iconv_module = { 69 | ICMOD_UC_CES, 70 | apr_iconv_mod_noevent, 71 | iconv_module_depend, 72 | &iconv_ces_desc 73 | }; 74 | -------------------------------------------------------------------------------- /ces/euc-tw.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "x-euc-tw", "euc-tw", NULL 38 | }; 39 | 40 | static const char * const * 41 | euc_names(struct iconv_ces *ces) 42 | { 43 | return names; 44 | } 45 | 46 | static struct iconv_ces_euc_ccs ccsattr[4] = { 47 | {"", 0}, 48 | {"", 0}, 49 | {"\x8e\xa2", 2}, 50 | {"\x8e\xae", 2} 51 | }; 52 | 53 | static const struct iconv_module_depend iconv_module_depend[] = { 54 | {ICMOD_UC_CCS, "us-ascii", ccsattr + 0}, 55 | {ICMOD_UC_CCS, "cns11643-plane1", ccsattr + 1}, 56 | {ICMOD_UC_CCS, "cns11643-plane2", ccsattr + 2}, 57 | {ICMOD_UC_CCS, "cns11643-plane14", ccsattr + 3}, 58 | END_ICONV_MODULE_DEPEND 59 | }; 60 | 61 | static const struct iconv_ces_desc iconv_ces_desc = { 62 | apr_iconv_euc_open, 63 | apr_iconv_euc_close, 64 | apr_iconv_ces_no_func, 65 | euc_names, 66 | apr_iconv_ces_nbits8, 67 | apr_iconv_ces_zero, 68 | apr_iconv_euc_convert_from_ucs, 69 | apr_iconv_euc_convert_to_ucs, 70 | }; 71 | 72 | struct iconv_module_desc iconv_module = { 73 | ICMOD_UC_CES, 74 | apr_iconv_mod_noevent, 75 | iconv_module_depend, 76 | &iconv_ces_desc 77 | }; 78 | -------------------------------------------------------------------------------- /ces/gb2312.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "gb2312", "euc-cn", "csGB2312", NULL 38 | }; 39 | 40 | static const char * const * 41 | euc_names(struct iconv_ces *ces) 42 | { 43 | return names; 44 | } 45 | 46 | static struct iconv_ces_euc_ccs ccsattr[2] = { 47 | {"", 0}, 48 | {"", 0} 49 | }; 50 | 51 | static const struct iconv_module_depend iconv_module_depend[] = { 52 | {ICMOD_UC_CCS, "us-ascii", ccsattr + 0}, 53 | {ICMOD_UC_CCS, "gb_2312-80", ccsattr + 1}, 54 | END_ICONV_MODULE_DEPEND 55 | }; 56 | 57 | static const struct iconv_ces_desc iconv_ces_desc = { 58 | apr_iconv_euc_open, 59 | apr_iconv_euc_close, 60 | apr_iconv_ces_no_func, 61 | euc_names, 62 | apr_iconv_ces_nbits8, 63 | apr_iconv_ces_zero, 64 | apr_iconv_euc_convert_from_ucs, 65 | apr_iconv_euc_convert_to_ucs 66 | }; 67 | 68 | struct iconv_module_desc iconv_module = { 69 | ICMOD_UC_CES, 70 | apr_iconv_mod_noevent, 71 | iconv_module_depend, 72 | &iconv_ces_desc 73 | }; 74 | -------------------------------------------------------------------------------- /ces/iso-10646-ucs-2.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999,2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | #include /* free, malloc */ 36 | 37 | static const char * const names[] = { 38 | "iso-10646-ucs-2", "csUnicode", "ucs-2", NULL 39 | }; 40 | 41 | static const char * const * 42 | ucs2_names(struct iconv_ces *ces) 43 | { 44 | return names; 45 | } 46 | 47 | static apr_ssize_t 48 | convert_from_ucs(struct iconv_ces *ces, ucs_t in, 49 | unsigned char **outbuf, apr_size_t *outbytesleft) 50 | { 51 | apr_size_t bytes; 52 | int *state = ces->data; 53 | 54 | if (in == UCS_CHAR_NONE) 55 | return 1; /* No state reinitialization for table charsets */ 56 | if (iconv_char32bit(in)) 57 | return -1; /* No such character in UCS-2 */ 58 | bytes = *state ? 2 : 4; 59 | if (*outbytesleft < bytes) 60 | return 0; /* No space in the output buffer */ 61 | if (*state == 0) { 62 | *(*outbuf)++ = 0xFE; 63 | *(*outbuf)++ = 0xFF; 64 | *state = 1; 65 | } 66 | *(*outbuf)++ = (in >> 8) & 0xFF; 67 | *(*outbuf)++ = in & 0xFF; 68 | *outbytesleft -= bytes; 69 | return 1; 70 | } 71 | 72 | static APR_INLINE ucs_t 73 | msb(const unsigned char *buf) 74 | { 75 | return (buf[0] << 8) | buf[1]; 76 | } 77 | 78 | static ucs_t 79 | convert_to_ucs(struct iconv_ces *ces, const unsigned char **inbuf, 80 | apr_size_t *inbytesleft) 81 | { 82 | ucs_t res; 83 | int *state = ces->data; 84 | int mark; 85 | 86 | if (*inbytesleft < 2) 87 | return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */ 88 | res = msb((const unsigned char*)*inbuf); 89 | switch (res) { 90 | case UCS_CHAR_ZERO_WIDTH_NBSP: 91 | *state = 1; 92 | mark = 1; 93 | break; 94 | case UCS_CHAR_INVALID: 95 | *state = 2; 96 | mark = 1; 97 | break; 98 | default: 99 | mark = 0; 100 | } 101 | if (mark) { 102 | if (*inbytesleft < 4) 103 | return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */ 104 | *inbytesleft -= 2; 105 | res = msb(*inbuf += 2); 106 | } 107 | if (*state == 2) { 108 | res = (unsigned char)(*(*inbuf) ++); 109 | res |= (unsigned char)(*(*inbuf) ++) << 8; 110 | } else 111 | *inbuf += 2; 112 | *inbytesleft -= 2; 113 | return res; 114 | } 115 | 116 | static const struct iconv_ces_desc iconv_ces_desc = { 117 | apr_iconv_ces_open_func, 118 | apr_iconv_ces_close_func, 119 | apr_iconv_ces_reset_func, 120 | ucs2_names, 121 | apr_iconv_ces_nbits8, 122 | apr_iconv_ces_zero, 123 | convert_from_ucs, 124 | convert_to_ucs, 125 | NULL 126 | }; 127 | 128 | struct iconv_module_desc iconv_module = { 129 | ICMOD_UC_CES, 130 | apr_iconv_mod_noevent, 131 | NULL, 132 | &iconv_ces_desc 133 | }; 134 | -------------------------------------------------------------------------------- /ces/iso-10646-ucs-4.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999,2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | #include /* free, malloc */ 36 | 37 | 38 | static const char * const names[] = { 39 | "iso-10646-ucs-2", "ucs-4", "ucs4", NULL 40 | }; 41 | 42 | static const char * const * 43 | ucs4_names(struct iconv_ces *ces) 44 | { 45 | return names; 46 | } 47 | 48 | static apr_ssize_t 49 | convert_from_ucs(struct iconv_ces *ces, ucs_t in, 50 | unsigned char **outbuf, apr_size_t *outbytesleft) 51 | { 52 | int *state = (int*)ces->data; 53 | apr_size_t bytes; 54 | 55 | if (in == UCS_CHAR_NONE) 56 | return 1; /* No state reinitialization for table charsets */ 57 | bytes = *state ? 4 : 8; 58 | if (*outbytesleft < bytes) 59 | return 0; /* No space in output buffer */ 60 | if (*state == 0) { 61 | *(*outbuf)++ = 0; 62 | *(*outbuf)++ = 0; 63 | *(*outbuf)++ = 0xFE; 64 | *(*outbuf)++ = 0xFF; 65 | *state = 1; 66 | } 67 | *(*outbuf)++ = (in >> 24) & 0xFF; 68 | *(*outbuf)++ = (in >> 16) & 0xFF; 69 | *(*outbuf)++ = (in >> 8) & 0xFF; 70 | *(*outbuf)++ = in & 0xFF; 71 | *outbytesleft -= bytes; 72 | return 1; 73 | } 74 | 75 | static APR_INLINE ucs_t 76 | msb(const unsigned char *buf) 77 | { 78 | return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; 79 | } 80 | 81 | static ucs_t 82 | convert_to_ucs(struct iconv_ces *ces, 83 | const unsigned char **inbuf, apr_size_t *inbytesleft) 84 | { 85 | ucs_t res; 86 | int *state = (int*)ces->data; 87 | int mark; 88 | 89 | if (*inbytesleft < 4) 90 | return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */ 91 | res = msb(*inbuf); 92 | switch (res) { 93 | case UCS_CHAR_ZERO_WIDTH_NBSP: 94 | *state = 1; 95 | mark = 1; 96 | break; 97 | case UCS_CHAR_INVALID: 98 | *state = 2; 99 | mark = 1; 100 | break; 101 | default: 102 | mark = 0; 103 | } 104 | if (mark) { 105 | if (*inbytesleft < 8) 106 | return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */ 107 | *inbytesleft -= 4; 108 | res = msb(*inbuf += 4); 109 | } 110 | if (*state == 2) { 111 | res = (unsigned char)(*(*inbuf) ++); 112 | res |= (unsigned char)(*(*inbuf) ++) << 8; 113 | res |= (unsigned char)(*(*inbuf) ++) << 16; 114 | res |= (unsigned char)(*(*inbuf) ++) << 24; 115 | } else 116 | *inbuf += 4; 117 | *inbytesleft -= 4; 118 | return res; 119 | } 120 | 121 | static const struct iconv_ces_desc iconv_ces_desc = { 122 | apr_iconv_ces_open_func, 123 | apr_iconv_ces_close_func, 124 | apr_iconv_ces_reset_func, 125 | ucs4_names, 126 | apr_iconv_ces_nbits8, 127 | apr_iconv_ces_zero, 128 | convert_from_ucs, 129 | convert_to_ucs, 130 | NULL 131 | }; 132 | 133 | struct iconv_module_desc iconv_module = { 134 | ICMOD_UC_CES, 135 | apr_iconv_mod_noevent, 136 | NULL, 137 | &iconv_ces_desc 138 | }; 139 | -------------------------------------------------------------------------------- /ces/iso-2022-cn.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "iso-2022-cn", NULL 38 | }; 39 | 40 | static const char * const * 41 | iso_names(struct iconv_ces *ces) 42 | { 43 | return names; 44 | } 45 | 46 | static const int shift_tab[] = { 0, -1, -1, -1 }; 47 | 48 | static const struct iconv_ces_iso2022_ccs ccsattr[] = { 49 | {ICONV_SHIFT_SI, "", 0}, 50 | {ICONV_SHIFT_SO, "\x1b$)A", 4}, 51 | {ICONV_SHIFT_SO, "\x1b$)G", 4}, 52 | {ICONV_SHIFT_SS2, "\x1b$*H", 4} 53 | }; 54 | 55 | static const struct iconv_module_depend iconv_module_depend[] = { 56 | {ICMOD_UC_CCS, "us-ascii", ccsattr + 0}, 57 | {ICMOD_UC_CCS, "gb_2312-80", ccsattr + 1}, 58 | {ICMOD_UC_CCS, "cns11643-plane1", ccsattr + 2}, 59 | {ICMOD_UC_CCS, "cns11643-plane2", ccsattr + 3}, 60 | END_ICONV_MODULE_DEPEND 61 | }; 62 | 63 | static const struct iconv_ces_desc iconv_ces_desc = { 64 | apr_iconv_iso2022_open, 65 | apr_iconv_iso2022_close, 66 | apr_iconv_iso2022_reset, 67 | iso_names, 68 | apr_iconv_ces_nbits7, 69 | apr_iconv_ces_zero, 70 | apr_iconv_iso2022_convert_from_ucs, 71 | apr_iconv_iso2022_convert_to_ucs, 72 | shift_tab 73 | }; 74 | 75 | struct iconv_module_desc iconv_module = { 76 | ICMOD_UC_CES, 77 | apr_iconv_mod_noevent, 78 | iconv_module_depend, 79 | &iconv_ces_desc 80 | }; 81 | -------------------------------------------------------------------------------- /ces/iso-2022-jp-2.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "iso-2022-jp-2", 38 | "csISO2022JP2", 39 | NULL 40 | }; 41 | 42 | static const char * const * 43 | iso_names(struct iconv_ces *ces) 44 | { 45 | return names; 46 | } 47 | 48 | static const int shift_tab[] = { 0, -1, -1, -1 }; 49 | 50 | static const struct iconv_ces_iso2022_ccs ccsattr[] = { 51 | {ICONV_SHIFT_SI, "\x1b(B", 3}, 52 | {ICONV_SHIFT_SI, "\x1b$@", 3}, 53 | {ICONV_SHIFT_SI, "\x1b$B", 3}, 54 | {ICONV_SHIFT_SI, "\x1b(J", 3}, 55 | {ICONV_SHIFT_SI, "\x1b$A", 3}, 56 | {ICONV_SHIFT_SI, "\x1b$(C", 4}, 57 | {ICONV_SHIFT_SI, "\x1b$(D", 4}, 58 | {ICONV_SHIFT_SS2, "\x1b.A", 3}, 59 | {ICONV_SHIFT_SS2, "\x1b.F", 3} 60 | }; 61 | 62 | static const struct iconv_module_depend iconv_module_depend[] = { 63 | {ICMOD_UC_CCS, "us-ascii", ccsattr + 0}, 64 | {ICMOD_UC_CCS, "jis_x0208-1983", ccsattr + 1 }, 65 | {ICMOD_UC_CCS, "jis_x0208-1983", ccsattr + 2 }, 66 | {ICMOD_UC_CCS, "jis_x0201", ccsattr + 3 }, 67 | {ICMOD_UC_CCS, "gb_2312-80", ccsattr + 4 }, 68 | {ICMOD_UC_CCS, "ksx1001", ccsattr + 5 }, 69 | {ICMOD_UC_CCS, "jis_x0212-1990", ccsattr + 6 }, 70 | {ICMOD_UC_CCS, "iso-8859-1", ccsattr + 7 }, 71 | {ICMOD_UC_CCS, "iso-8859-7", ccsattr + 8 }, 72 | END_ICONV_MODULE_DEPEND 73 | }; 74 | 75 | static const struct iconv_ces_desc iconv_ces_desc = { 76 | apr_iconv_iso2022_open, 77 | apr_iconv_iso2022_close, 78 | apr_iconv_iso2022_reset, 79 | iso_names, 80 | apr_iconv_ces_nbits7, 81 | apr_iconv_ces_zero, 82 | apr_iconv_iso2022_convert_from_ucs, 83 | apr_iconv_iso2022_convert_to_ucs, 84 | shift_tab 85 | }; 86 | 87 | struct iconv_module_desc iconv_module = { 88 | ICMOD_UC_CES, 89 | apr_iconv_mod_noevent, 90 | iconv_module_depend, 91 | &iconv_ces_desc 92 | }; 93 | -------------------------------------------------------------------------------- /ces/iso-2022-jp.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "iso-2022-jp", 38 | "csISO2022JP", 39 | NULL 40 | }; 41 | 42 | static const char * const * 43 | iso_names(struct iconv_ces *ces) 44 | { 45 | return names; 46 | } 47 | 48 | static const int shift_tab[] = { 0, -1, -1, -1 }; 49 | 50 | static const struct iconv_ces_iso2022_ccs ccsattr[] = { 51 | {ICONV_SHIFT_SI, "\x1b(B", 3 }, 52 | {ICONV_SHIFT_SI, "\x1b(J", 3 }, 53 | {ICONV_SHIFT_SI, "\x1b$@", 3 }, 54 | {ICONV_SHIFT_SI, "\x1b$B", 3 } 55 | }; 56 | 57 | static const struct iconv_module_depend iconv_module_depend[] = { 58 | {ICMOD_UC_CCS, "us-ascii", ccsattr + 0}, 59 | {ICMOD_UC_CCS, "jis_x0201", ccsattr + 1}, 60 | {ICMOD_UC_CCS, "jis_x0208-1983", ccsattr + 2}, 61 | {ICMOD_UC_CCS, "jis_x0208-1983", ccsattr + 3}, 62 | END_ICONV_MODULE_DEPEND 63 | }; 64 | 65 | static const struct iconv_ces_desc iconv_ces_desc = { 66 | apr_iconv_iso2022_open, 67 | apr_iconv_iso2022_close, 68 | apr_iconv_iso2022_reset, 69 | iso_names, 70 | apr_iconv_ces_nbits7, 71 | apr_iconv_ces_zero, 72 | apr_iconv_iso2022_convert_from_ucs, 73 | apr_iconv_iso2022_convert_to_ucs, 74 | shift_tab 75 | }; 76 | 77 | struct iconv_module_desc iconv_module = { 78 | ICMOD_UC_CES, 79 | apr_iconv_mod_noevent, 80 | iconv_module_depend, 81 | &iconv_ces_desc 82 | }; 83 | -------------------------------------------------------------------------------- /ces/iso-2022-kr.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "iso-2022-kr", 38 | NULL 39 | }; 40 | 41 | static const char * const * 42 | iso_names(struct iconv_ces *ces) 43 | { 44 | return names; 45 | } 46 | 47 | static const int shift_tab[] = { 0, -1, -1, -1 }; 48 | 49 | static const struct iconv_ces_iso2022_ccs ccsattr[] = { 50 | { ICONV_SHIFT_SI, "", 0 }, 51 | { ICONV_SHIFT_SO, "\x1b$)C", 4 } 52 | }; 53 | 54 | static const struct iconv_module_depend iconv_module_depend[] = { 55 | {ICMOD_UC_CCS, "us-ascii", ccsattr + 0}, 56 | {ICMOD_UC_CCS, "ksx1001", ccsattr + 1}, 57 | END_ICONV_MODULE_DEPEND 58 | }; 59 | 60 | static const struct iconv_ces_desc iconv_ces_desc = { 61 | apr_iconv_iso2022_open, 62 | apr_iconv_iso2022_close, 63 | apr_iconv_iso2022_reset, 64 | iso_names, 65 | apr_iconv_ces_nbits7, 66 | apr_iconv_ces_zero, 67 | apr_iconv_iso2022_convert_from_ucs, 68 | apr_iconv_iso2022_convert_to_ucs, 69 | shift_tab 70 | }; 71 | 72 | struct iconv_module_desc iconv_module = { 73 | ICMOD_UC_CES, 74 | apr_iconv_mod_noevent, 75 | iconv_module_depend, 76 | &iconv_ces_desc 77 | }; 78 | -------------------------------------------------------------------------------- /ces/ucs2-internal.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999,2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "ucs2-internal", NULL 38 | }; 39 | 40 | static const char * const * 41 | ucs2_names(struct iconv_ces *ces) 42 | { 43 | return names; 44 | } 45 | 46 | static APR_INLINE int 47 | ucs2_nbytes(struct iconv_ces *ces) 48 | { 49 | return sizeof(ucs2_t); 50 | } 51 | 52 | static apr_ssize_t 53 | convert_from_ucs(struct iconv_ces *ces, ucs_t in, 54 | unsigned char **outbuf, apr_size_t *outbytesleft) 55 | { 56 | ucs2_t *ptr = (ucs2_t *) *outbuf; 57 | if (in == UCS_CHAR_NONE) 58 | return 1; /* No state reinitialization for table charsets */ 59 | if (iconv_char32bit(in)) 60 | return -1; /* No corresponding character in UCS-2 */ 61 | if (*outbytesleft < sizeof(ucs2_t)) 62 | return 0; /* No space in the output buffer */ 63 | *ptr = (ucs2_t) in; 64 | *outbuf += sizeof(ucs2_t); 65 | (*outbytesleft) -= sizeof(ucs2_t); 66 | return 1; 67 | } 68 | 69 | static ucs_t 70 | convert_to_ucs(struct iconv_ces *ces, 71 | const unsigned char **inbuf, apr_size_t *inbytesleft) 72 | { 73 | const ucs2_t *ret = (const ucs2_t *)*inbuf; 74 | if (*inbytesleft < sizeof(ucs2_t)) 75 | return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */ 76 | (*inbytesleft) -= sizeof(ucs2_t); 77 | *inbuf += sizeof(ucs2_t); 78 | return *ret; 79 | } 80 | 81 | static const struct iconv_ces_desc iconv_ces_desc = { 82 | apr_iconv_ces_open_zero, 83 | apr_iconv_ces_zero, 84 | apr_iconv_ces_no_func, 85 | ucs2_names, 86 | apr_iconv_ces_nbits8, 87 | ucs2_nbytes, 88 | convert_from_ucs, 89 | convert_to_ucs, 90 | NULL 91 | }; 92 | 93 | struct iconv_module_desc iconv_module = { 94 | ICMOD_UC_CES, 95 | apr_iconv_mod_noevent, 96 | NULL, 97 | &iconv_ces_desc 98 | }; 99 | -------------------------------------------------------------------------------- /ces/ucs4-internal.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999,2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "ucs4-internal", NULL 38 | }; 39 | 40 | static const char * const * 41 | ucs4_names(struct iconv_ces *ces) 42 | { 43 | return names; 44 | } 45 | 46 | static APR_INLINE int 47 | ucs4_nbytes(struct iconv_ces *ces) 48 | { 49 | return sizeof(ucs4_t); 50 | } 51 | 52 | static apr_ssize_t 53 | convert_from_ucs(struct iconv_ces *ces, ucs_t in, 54 | unsigned char **outbuf, apr_size_t *outbytesleft) 55 | { 56 | ucs4_t *ptr = (ucs4_t*) *outbuf; 57 | if (in == UCS_CHAR_NONE) 58 | return 1; /* No state reinitialization for table charsets */ 59 | if (*outbytesleft < sizeof(ucs4_t)) 60 | return 0; /* No space in the output buffer */ 61 | *ptr = (ucs4_t) in; 62 | *outbuf += sizeof(ucs4_t); 63 | (*outbytesleft) -= sizeof(ucs4_t); 64 | return 1; 65 | } 66 | 67 | static ucs_t 68 | convert_to_ucs(struct iconv_ces *ces, 69 | const unsigned char **inbuf, apr_size_t *inbytesleft) 70 | { 71 | const ucs4_t *ret = (const ucs4_t *)*inbuf; 72 | if (*inbytesleft < sizeof(ucs4_t)) 73 | return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */ 74 | (*inbytesleft) -= sizeof(ucs4_t); 75 | *inbuf += sizeof(ucs4_t); 76 | return *ret; 77 | } 78 | 79 | static const struct iconv_ces_desc iconv_ces_desc = { 80 | apr_iconv_ces_open_zero, 81 | apr_iconv_ces_zero, 82 | apr_iconv_ces_no_func, 83 | ucs4_names, 84 | apr_iconv_ces_nbits8, 85 | ucs4_nbytes, 86 | convert_from_ucs, 87 | convert_to_ucs, 88 | NULL 89 | }; 90 | 91 | struct iconv_module_desc iconv_module = { 92 | ICMOD_UC_CES, 93 | apr_iconv_mod_noevent, 94 | NULL, 95 | &iconv_ces_desc 96 | }; 97 | -------------------------------------------------------------------------------- /ces/utf-16.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999,2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "utf-16", "iso-10646-utf-16", "utf16", NULL 38 | }; 39 | 40 | static const char * const * 41 | utf16_names(struct iconv_ces *ces) 42 | { 43 | return names; 44 | } 45 | 46 | static apr_ssize_t 47 | convert_from_ucs(struct iconv_ces *ces, ucs_t in, 48 | unsigned char **outbuf, apr_size_t *outbytesleft) 49 | { 50 | unsigned char *cp; 51 | int *state = (int *)ces->data; 52 | apr_size_t bytes; 53 | 54 | if (in == UCS_CHAR_NONE) 55 | return 1; /* No state reinitialization for table charsets */ 56 | if (in > 0x10FFFF) 57 | return -1; 58 | bytes = *state ? 2 : 4; 59 | if (in > 0xFFFF) 60 | bytes += 2; 61 | if (*outbytesleft < bytes) 62 | return 0; /* No space in the output buffer */ 63 | cp = *outbuf; 64 | if (*state == 0) { 65 | *cp++ = 0xFE; 66 | *cp++ = 0xFF; 67 | *state = 1; 68 | } 69 | if (in > 0xFFFF) { 70 | *cp++ = ((in -= 0x10000) >> 18) | 0xD8; 71 | *cp++ = (in >> 10) & 0xFF; 72 | *cp++ = ((in >> 8) & 3) | 0xDC; 73 | } else 74 | *cp++ = (in >> 8) & 0xFF; 75 | *cp++ = in & 0xFF; 76 | (*outbuf) += bytes; 77 | *outbytesleft -= bytes; 78 | return 1; 79 | } 80 | 81 | static APR_INLINE ucs_t 82 | msb(const unsigned char *buf) 83 | { 84 | return (buf[0] << 8) | buf[1]; 85 | } 86 | 87 | static ucs_t 88 | convert_to_ucs(struct iconv_ces *ces, 89 | const unsigned char **inbuf, apr_size_t *inbytesleft) 90 | { 91 | ucs_t res, res2; 92 | int *state = (int *)ces->data; 93 | int mark; 94 | 95 | if (*inbytesleft < 2) 96 | return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */ 97 | res = msb(*inbuf); 98 | switch (res) { 99 | case UCS_CHAR_ZERO_WIDTH_NBSP: 100 | *state = 1; 101 | mark = 1; 102 | break; 103 | case UCS_CHAR_INVALID: 104 | *state = 2; 105 | mark = 1; 106 | break; 107 | default: 108 | mark = 0; 109 | } 110 | if (mark) { 111 | if (*inbytesleft < 4) 112 | return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */ 113 | *inbytesleft -= 2; 114 | res = msb((*inbuf) += 2); 115 | } 116 | if (*state == 2) { /* LSB order */ 117 | res = (*(*inbuf) ++); 118 | res |= (*(*inbuf) ++) << 8; 119 | } else 120 | *inbuf += 2; 121 | *inbytesleft -= 2; 122 | if ((res & 0xFC00) != 0xD800) /* Non-surrogate character */ 123 | return res; 124 | if (*inbytesleft < 2) 125 | return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */ 126 | if (*state == 2) { 127 | res2 = (*inbuf)[0]; 128 | res2 |= (*inbuf)[1] << 8; 129 | } else 130 | res2 = msb(*inbuf); 131 | if ((res2 & 0xFC00) != 0xDC00) /* Broken surrogate pair */ 132 | return -1; 133 | (*inbuf) += 2; 134 | (*inbytesleft) -= 2; 135 | return (((res & 0x3FF) << 10) | (res2 & 0x3FF)) + 0x10000; 136 | } 137 | 138 | static const struct iconv_ces_desc iconv_ces_desc = { 139 | apr_iconv_ces_open_func, 140 | apr_iconv_ces_close_func, 141 | apr_iconv_ces_reset_func, 142 | utf16_names, 143 | apr_iconv_ces_nbits8, 144 | apr_iconv_ces_zero, 145 | convert_from_ucs, 146 | convert_to_ucs, 147 | NULL 148 | }; 149 | 150 | struct iconv_module_desc iconv_module = { 151 | ICMOD_UC_CES, 152 | apr_iconv_mod_noevent, 153 | NULL, 154 | &iconv_ces_desc 155 | }; 156 | -------------------------------------------------------------------------------- /ces/utf-8.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999,2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | static const char * const names[] = { 37 | "utf-8", "iso-10646-utf-8", "utf8", NULL 38 | }; 39 | 40 | static const char * const * 41 | utf8_names(struct iconv_ces *ces) 42 | { 43 | return names; 44 | } 45 | 46 | #define cont_byte(b) (((b) & 0x3F) | 0x80) 47 | 48 | static apr_ssize_t 49 | convert_from_ucs(struct iconv_ces *ces, ucs_t in, 50 | unsigned char **outbuf, apr_size_t *outbytesleft) 51 | { 52 | unsigned char *cp; 53 | apr_size_t n; 54 | 55 | if (in == UCS_CHAR_NONE) 56 | return 1; /* No state reinitialization for table charsets */ 57 | if (in < 0x80) { 58 | n = 1; 59 | } else if (in < 0x800) { 60 | n = 2; 61 | } else if (in < 0x10000) { 62 | n = 3; 63 | } else if (in < 0x110000) { 64 | n = 4; 65 | } else 66 | return -1; 67 | if (*outbytesleft < n) 68 | return 0; 69 | cp = *outbuf; 70 | switch (n) { 71 | case 1: 72 | *cp = (unsigned char)in; 73 | break; 74 | case 2: 75 | *cp++ = (unsigned char)((in >> 6) | 0xC0); 76 | *cp++ = (unsigned char)cont_byte(in); 77 | break; 78 | case 3: 79 | *cp++ = (unsigned char)((in >> 12) | 0xE0); 80 | *cp++ = (unsigned char)cont_byte(in >> 6); 81 | *cp++ = (unsigned char)cont_byte(in); 82 | break; 83 | case 4: 84 | *cp++ = (unsigned char)((in >> 18) | 0xF0); 85 | *cp++ = (unsigned char)cont_byte(in >> 12); 86 | *cp++ = (unsigned char)cont_byte(in >> 6); 87 | *cp++ = (unsigned char)cont_byte(in); 88 | break; 89 | } 90 | (*outbytesleft) -= n; 91 | (*outbuf) += n; 92 | return 1; 93 | } 94 | 95 | static ucs_t 96 | convert_to_ucs(struct iconv_ces *ces, 97 | const unsigned char **inbuf, apr_size_t *inbytesleft) 98 | { 99 | const unsigned char *in = *inbuf; 100 | unsigned char byte = *in++; 101 | ucs_t res = byte; 102 | 103 | if (byte >= 0xC0) { 104 | if (byte < 0xE0) { 105 | if (*inbytesleft < 2) 106 | return UCS_CHAR_NONE; 107 | res = (*in & 0xC0) == 0x80 ? 108 | ((byte & 0x1F) << 6) | (*in++ & 0x3F) : 109 | UCS_CHAR_INVALID; 110 | } else if (byte < 0xF0) { 111 | if (*inbytesleft < 3) 112 | return UCS_CHAR_NONE; 113 | if (((in[0] & 0xC0) == 0x80) && ((in[1] & 0xC0) == 0x80)) { 114 | res = ((byte & 0x0F) << 12) | ((in[0] & 0x3F) << 6) 115 | | (in[1] & 0x3F); 116 | in += 2; 117 | } else 118 | res = UCS_CHAR_INVALID; 119 | } else if (byte <= 0xF4) { 120 | if (*inbytesleft < 4) 121 | return UCS_CHAR_NONE; 122 | if (((byte == 0xF4 && ((in[0] & 0xF0) == 0x80)) 123 | || ((in[0] & 0xC0) == 0x80)) 124 | && ((in[1] & 0xC0) == 0x80) 125 | && ((in[2] & 0xC0) == 0x80)) { 126 | res = ((byte & 0x7) << 18) | ((in[0] & 0x3F) << 12) 127 | | ((in[1] & 0x3F) << 6) | (in[2] & 0x3F); 128 | in += 3; 129 | } else 130 | res = UCS_CHAR_INVALID; 131 | } else 132 | res = UCS_CHAR_INVALID; 133 | } else if (byte & 0x80) 134 | res = UCS_CHAR_INVALID; 135 | 136 | (*inbytesleft) -= (in - *inbuf); 137 | *inbuf = in; 138 | return res; 139 | } 140 | 141 | static const struct iconv_ces_desc iconv_ces_desc = { 142 | apr_iconv_ces_open_zero, 143 | apr_iconv_ces_zero, 144 | apr_iconv_ces_no_func, 145 | utf8_names, 146 | apr_iconv_ces_nbits8, 147 | apr_iconv_ces_zero, 148 | convert_from_ucs, 149 | convert_to_ucs, 150 | NULL 151 | }; 152 | 153 | struct iconv_module_desc iconv_module = { 154 | ICMOD_UC_CES, 155 | apr_iconv_mod_noevent, 156 | NULL, 157 | &iconv_ces_desc 158 | }; 159 | -------------------------------------------------------------------------------- /configure.in: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl Process this file with autoconf to produce a configure script 3 | dnl 4 | 5 | AC_PREREQ(2.13) 6 | AC_INIT(Makefile.in) 7 | 8 | AC_CONFIG_AUX_DIR(build) 9 | AC_CONFIG_HEADER(lib/apr_iconv_private.h) 10 | AC_PREFIX_DEFAULT(/usr/local/apache2) 11 | 12 | sinclude(build/apr-iconv.m4) 13 | sinclude(build/apr_common.m4) 14 | sinclude(build/find_apr.m4) 15 | 16 | dnl This is required by autoconf! 17 | AC_PROG_AWK 18 | AC_PROG_INSTALL 19 | 20 | dnl compute the top directory of the build 21 | # Absolute source/build directory 22 | api_srcdir=`(cd $srcdir && pwd)` 23 | api_builddir=`pwd` 24 | AC_SUBST(api_srcdir) 25 | AC_SUBST(api_builddir) 26 | 27 | if test "$api_builddir" != "$api_srcdir"; then 28 | USE_VPATH=1 29 | fi 30 | 31 | dnl Default prefix path if none was specified 32 | test "x$prefix" = xNONE && prefix=$ac_default_prefix 33 | 34 | dnl check for APR 35 | API_FIND_APR 36 | 37 | dnl copy apr's rules.mk into our build directory. 38 | if test ! -d $api_builddir/build ; then 39 | mkdir $api_builddir/build 40 | fi 41 | cp $APR_BUILD_DIR/apr_rules.mk $api_builddir/build/rules.mk 42 | 43 | dnl 44 | dnl set up the compilation flags and stuff 45 | dnl 46 | API_INCLUDES="-I$api_builddir/lib -I$api_builddir/include" 47 | if test -n "$USE_VPATH"; then 48 | API_INCLUDES="$API_INCLUDES -I$api_srcdir/lib -I$api_srcdir/include" 49 | fi 50 | 51 | AC_SUBST(API_INCLUDES) 52 | 53 | AC_SUBST(APR_SO_EXT) 54 | 55 | dnl Adds in config *.h file 56 | AC_DEFINE_UNQUOTED(ICONV_DEFAULT_PATH,"$prefix/lib/iconv", 57 | [ Directory where the *.so tables are stored ] ) 58 | iconv_libdir=$prefix/lib/iconv 59 | AC_SUBST(iconv_libdir) 60 | 61 | dnl 62 | dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles 63 | dnl 64 | case "$host_alias" in 65 | *bsdi*) 66 | INCLUDE_RULES=".include \"$api_builddir/build/rules.mk\"" 67 | ;; 68 | *) 69 | INCLUDE_RULES="include $api_builddir/build/rules.mk" 70 | ;; 71 | esac 72 | AC_SUBST(INCLUDE_RULES) 73 | 74 | dnl supportes MinGW 75 | case "$host_alias" in 76 | *mingw*) 77 | API_CPPFLAGS="-DAPI_DECLARE_EXPORT" 78 | ;; 79 | esac 80 | AC_SUBST(API_CPPFLAGS) 81 | 82 | dnl Absolute source/build directory 83 | abs_srcdir=`(cd $srcdir && pwd)` 84 | 85 | dnl get our version information 86 | get_version="$abs_srcdir/build/get-version.sh" 87 | version_hdr="$abs_srcdir/include/api_version.h" 88 | API_MAJOR_VERSION="`$get_version major $version_hdr API`" 89 | API_LIBNAME="apriconv-${API_MAJOR_VERSION}" 90 | AC_SUBST(API_LIBNAME) 91 | API_INCPATH="apr-${API_MAJOR_VERSION}" 92 | AC_SUBST(API_INCPATH) 93 | LT_VERSION="-version-info `$get_version libtool $version_hdr API`" 94 | AC_SUBST(LT_VERSION) 95 | 96 | dnl 97 | dnl everthing is done. 98 | AC_OUTPUT([ 99 | Makefile 100 | ccs/Makefile 101 | ces/Makefile 102 | lib/Makefile 103 | util/Makefile 104 | ]) 105 | -------------------------------------------------------------------------------- /docs/doxygen.conf: -------------------------------------------------------------------------------- 1 | PROJECT_NAME="Apache Portable Runtime Iconv Library" 2 | 3 | INPUT=. 4 | QUIET=YES 5 | RECURSIVE=YES 6 | FILE_PATTERNS=*.h 7 | 8 | OUTPUT_DIRECTORY=docs/dox 9 | 10 | MACRO_EXPANSION=YES 11 | EXPAND_ONLY_PREDEF=YES 12 | #EXPAND_AS_DEFINED= 13 | # not sure why this doesn't work as EXPAND_AS_DEFINED, it should! 14 | PREDEFINED="API_DECLARE(x)=x" \ 15 | "API_DECLARE_NONSTD(x)=x" \ 16 | "API_DECLARE_DATA" \ 17 | "__attribute__(x)=" \ 18 | DOXYGEN= 19 | 20 | OPTIMIZE_OUTPUT_FOR_C=YES 21 | STRIP_CODE_COMMENTS=NO 22 | 23 | FULL_PATH_NAMES=YES 24 | CASE_SENSE_NAMES=NO 25 | # some autoconf guru needs to make configure set this correctly... 26 | # in the meantime, simply listing the headers should be alright 27 | #STRIP_FROM_PATH=c:/projects/apr-iconv/ 28 | 29 | GENERATE_TAGFILE=docs/dox/api.tag 30 | 31 | -------------------------------------------------------------------------------- /include/api_version.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2000-2019 The Apache Software Foundation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef API_VERSION_H 17 | #define API_VERSION_H 18 | 19 | /** 20 | * @file api_version.h 21 | * @brief APR-iconv Versioning Interface 22 | * 23 | * APR-iconv's Version 24 | * 25 | * There are several different mechanisms for accessing the version. There 26 | * is a string form, and a set of numbers; in addition, there are constants 27 | * which can be compiled into your application, and you can query the library 28 | * being used for its actual version. 29 | * 30 | * Note that it is possible for an application to detect that it has been 31 | * compiled against a different version of API by use of the compile-time 32 | * constants and the use of the run-time query function. 33 | * 34 | * API version numbering follows the guidelines specified in: 35 | * 36 | * http://apr.apache.org/versioning.html 37 | */ 38 | 39 | 40 | /* The numeric compile-time version constants. These constants are the 41 | * authoritative version numbers for API. 42 | */ 43 | 44 | /** major version 45 | * Major API changes that could cause compatibility problems for older 46 | * programs such as structure size changes. No binary compatibility is 47 | * possible across a change in the major version. 48 | */ 49 | #define API_MAJOR_VERSION 1 50 | 51 | /** minor version 52 | * Minor API changes that do not cause binary compatibility problems. 53 | * Reset to 0 when upgrading API_MAJOR_VERSION 54 | */ 55 | #define API_MINOR_VERSION 2 56 | 57 | /** patch level 58 | * The Patch Level never includes API changes, simply bug fixes. 59 | * Reset to 0 when upgrading API_MINOR_VERSION 60 | */ 61 | #define API_PATCH_VERSION 3 62 | 63 | /** 64 | * The symbol API_IS_DEV_VERSION is only defined for internal, 65 | * "development" copies of API. It is undefined for released versions 66 | * of API. 67 | */ 68 | #define API_IS_DEV_VERSION 69 | 70 | 71 | #if defined(API_IS_DEV_VERSION) || defined(DOXYGEN) 72 | /** Internal: string form of the "is dev" flag */ 73 | #define API_IS_DEV_STRING "-dev" 74 | #else 75 | #define API_IS_DEV_STRING "" 76 | #endif 77 | 78 | #ifndef API_STRINGIFY 79 | /** Properly quote a value as a string in the C preprocessor */ 80 | #define API_STRINGIFY(n) API_STRINGIFY_HELPER(n) 81 | /** Helper macro for API_STRINGIFY */ 82 | #define API_STRINGIFY_HELPER(n) #n 83 | #endif 84 | 85 | /** The formatted string of API's version */ 86 | #define API_VERSION_STRING \ 87 | API_STRINGIFY(API_MAJOR_VERSION) "." \ 88 | API_STRINGIFY(API_MINOR_VERSION) "." \ 89 | API_STRINGIFY(API_PATCH_VERSION) \ 90 | API_IS_DEV_STRING 91 | 92 | /** An alternative formatted string of APR's version */ 93 | /* macro for Win32 .rc files using numeric csv representation */ 94 | #define API_VERSION_STRING_CSV API_MAJOR_VERSION ##, \ 95 | ##API_MINOR_VERSION ##, \ 96 | ##API_PATCH_VERSION 97 | 98 | 99 | #ifndef API_VERSION_ONLY 100 | 101 | /* The C language API to access the version at run time, 102 | * as opposed to compile time. API_VERSION_ONLY may be defined 103 | * externally when preprocessing apr_version.h to obtain strictly 104 | * the C Preprocessor macro declarations. 105 | */ 106 | 107 | #include "apr_version.h" 108 | 109 | #include "apr_iconv.h" 110 | 111 | #ifdef __cplusplus 112 | extern "C" { 113 | #endif 114 | 115 | /** 116 | * Return APR-iconv's version information information in a numeric form. 117 | * 118 | * @param pvsn Pointer to a version structure for returning the version 119 | * information. 120 | */ 121 | API_DECLARE(void) api_version(apr_version_t *pvsn); 122 | 123 | /** Return API's version information as a string. */ 124 | API_DECLARE(const char *) api_version_string(void); 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #endif /* ndef API_VERSION_ONLY */ 131 | 132 | #endif /* ndef API_VERSION_H */ 133 | -------------------------------------------------------------------------------- /lib/Makefile.in: -------------------------------------------------------------------------------- 1 | # Generated automatically from Makefile.in by configure. 2 | abs_srcdir=@api_srcdir@ 3 | abs_builddir=@api_builddir@ 4 | VPATH = @srcdir@ 5 | 6 | prefix=@prefix@ 7 | exec_prefix=@exec_prefix@ 8 | libdir=@libdir@ 9 | 10 | INCLUDES = @API_INCLUDES@ @APR_INCLUDES@ 11 | 12 | TARGET_LIB = lib@API_LIBNAME@.la 13 | SUBDIRS = . 14 | 15 | EXPORT_FILES = $(abs_srcdir)/include/*.h $(abs_srcdir)/lib/*.h 16 | TARGET_EXPORTS = apriconv.exports 17 | 18 | CLEAN_TARGETS = exports.c 19 | 20 | # May need to do something for apriconv.exports 21 | TARGETS = $(TARGET_LIB) 22 | 23 | OBJECTS_all = iconv_module.lo iconv.lo iconv_int.lo iconv_uc.lo \ 24 | iconv_ces.lo iconv_ces_euc.lo iconv_ces_iso2022.lo api_version.lo \ 25 | iconv_ccs.lo exports.lo 26 | 27 | LT_VERSION = @LT_VERSION@ 28 | # bring in rules.mk for standard functionality 29 | @INCLUDE_RULES@ 30 | # replace build-outputs.mk 31 | OBJECTS_unix = $(OBJECTS_all) 32 | 33 | OBJECTS_aix = $(OBJECTS_all) 34 | 35 | OBJECTS_beos = $(OBJECTS_all) 36 | 37 | OBJECTS_os2 = $(OBJECTS_all) 38 | 39 | OBJECTS_os390 = $(OBJECTS_all) 40 | 41 | OBJECTS_win32 = $(OBJECTS_all) 42 | # end replace 43 | 44 | $(TARGET_LIB): $(OBJECTS) 45 | $(LINK) @APR_LIB_TARGET@ 46 | 47 | exports.c: 48 | $(AWK) -f $(abs_srcdir)/build/make_exports.awk $(EXPORT_FILES) > $@ 49 | 50 | export_vars.h: 51 | $(AWK) -f $(abs_srcdir)/build/make_var_export.awk $(EXPORT_FILES) > $@ 52 | 53 | $(TARGET_EXPORTS): exports.c export_vars.h 54 | @echo "#! lib@API_LIBNAME@.so" > $@ 55 | @echo "* This file was AUTOGENERATED at build time." >> $@ 56 | @echo "* Please do not edit by hand." >> $@ 57 | $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@ 58 | $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.h | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' >> $@ 59 | -------------------------------------------------------------------------------- /lib/api_version.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2000-2004 The Apache Software Foundation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include "apr_iconv.h" 17 | #include "api_version.h" 18 | 19 | API_DECLARE(void) api_version(apr_version_t *pvsn) 20 | { 21 | pvsn->major = API_MAJOR_VERSION; 22 | pvsn->minor = API_MINOR_VERSION; 23 | pvsn->patch = API_PATCH_VERSION; 24 | #ifdef API_IS_DEV_VERSION 25 | pvsn->is_dev = 1; 26 | #else 27 | pvsn->is_dev = 0; 28 | #endif 29 | } 30 | 31 | API_DECLARE(const char *) api_version_string(void) 32 | { 33 | return API_VERSION_STRING; 34 | } 35 | -------------------------------------------------------------------------------- /lib/iconv.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999,2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | #ifndef HAVE_ICONV 37 | 38 | #include /* free, malloc */ 39 | #include 40 | 41 | static struct iconv_converter_desc *converters[] = { 42 | &iconv_uc_desc, /* CS1-UNICODE-CS2 converter */ 43 | /* &iconv_tc_desc, */ /* XLAT (table based converter) */ 44 | NULL 45 | }; 46 | 47 | /* 48 | * apr_size_t *result is what the iconv() returns but it is cleaner to return 49 | * a status. 50 | * APR_EBADF: cd is not valid. 51 | * APR_BADARG: The ouput arguments are not valid. 52 | */ 53 | 54 | API_DECLARE(apr_status_t) 55 | apr_iconv(apr_iconv_t cd, const char **inbuf, apr_size_t *inbytesleft, 56 | char **outbuf, apr_size_t *outbytesleft, apr_size_t *result) 57 | { 58 | struct iconv_converter *icp = (struct iconv_converter *)cd; 59 | 60 | if (icp == NULL) { 61 | *result = (apr_size_t) -1; 62 | return(APR_EBADF); 63 | } 64 | if (outbytesleft == NULL || *outbytesleft == 0 || 65 | outbuf == NULL || *outbuf == 0) { 66 | *result = (apr_size_t) -1; 67 | return(APR_BADARG); 68 | } 69 | return ( icp->ic_desc->icd_conv(icp->ic_data, 70 | (const unsigned char**)inbuf, inbytesleft, 71 | (unsigned char**)outbuf, outbytesleft, result)); 72 | } 73 | 74 | API_DECLARE(apr_status_t) 75 | apr_iconv_open(const char *to, const char *from, apr_pool_t *ctx, apr_iconv_t *res) 76 | { 77 | struct iconv_converter_desc **idesc; 78 | struct iconv_converter *icp; 79 | void *data; 80 | apr_status_t error; 81 | 82 | *res = (apr_iconv_t)-1; 83 | icp = malloc(sizeof(*icp)); 84 | if (icp == NULL) 85 | return (APR_ENOMEM); 86 | error = APR_EINVAL; 87 | for (idesc = converters; *idesc; idesc++) { 88 | error = (*idesc)->icd_open(to, from, &data, ctx); 89 | if (error == APR_SUCCESS) 90 | break; 91 | } 92 | if (error) { 93 | free(icp); 94 | return (error); 95 | } 96 | icp->ic_desc = *idesc; 97 | icp->ic_data = data; 98 | *res = icp; 99 | return(APR_SUCCESS); 100 | } 101 | 102 | API_DECLARE(apr_status_t) 103 | apr_iconv_close(apr_iconv_t cd, apr_pool_t *ctx) 104 | { 105 | struct iconv_converter *icp = (struct iconv_converter *)cd; 106 | int error = 0; 107 | 108 | if (icp == NULL) 109 | return(APR_EBADF); 110 | 111 | if (icp->ic_desc) 112 | error = icp->ic_desc->icd_close(icp->ic_data, ctx); 113 | 114 | free(icp); 115 | return error; 116 | } 117 | 118 | #else 119 | 120 | apr_status_t apr_iconv_open(const char *to_charset, 121 | const char *from_charset, apr_pool_t *ctx, apr_iconv_t **res) 122 | { 123 | *res = iconv_open(to_charset, from_charset); 124 | if (*res == (apr_iconv_t *) -1) 125 | return apr_get_os_error(); 126 | return APR_SUCCESS; 127 | } 128 | 129 | apr_status_t apr_iconv(apr_iconv_t cd, const char **inbuf, 130 | apr_size_t *inbytesleft, char **outbuf, 131 | apr_size_t *outbytesleft, apr_size_t *result) 132 | { 133 | *result = iconv(cd , inbuf, inbytesleft, outbuf, outbytesleft); 134 | if (*result == (apr_size_t) -1) 135 | return apr_get_os_error(); 136 | return APR_SUCCESS; 137 | } 138 | apr_status_t apr_iconv_close(apr_iconv_t cd, apr_pool_t *ctx) 139 | { 140 | int status; 141 | if (iconv_close(cd)) 142 | return apr_get_os_error(); 143 | return APR_SUCCESS; 144 | } 145 | 146 | #endif /* !defined(HAVE_ICONV) */ 147 | -------------------------------------------------------------------------------- /lib/iconv_ccs.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999, 2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" /* iconv_ccs_desc, iconv_ccs_module */ 35 | 36 | API_DECLARE_NONSTD(int) 37 | apr_iconv_ccs_event(struct iconv_module *mod, int event, apr_pool_t *ctx) 38 | { 39 | /* struct iconv_ccs_desc *desc = 40 | (struct iconv_ccs_desc *)mod->im_desc->imd_data;*/ 41 | 42 | switch (event) { 43 | case ICMODEV_LOAD: 44 | if (mod->im_deplist == NULL) 45 | return APR_EINVAL; 46 | mod->im_methods = mod->im_deplist->im_desc->imd_data; 47 | mod->im_data = mod->im_desc->imd_data; 48 | break; 49 | case ICMODEV_UNLOAD: 50 | break; 51 | default: 52 | return EINVAL; 53 | } 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /lib/iconv_ces.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999, 2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" /* iconv_ccs_desc, iconv_ccs */ 35 | 36 | #include /* PATH_MAX */ 37 | #include /* free, malloc */ 38 | #include 39 | 40 | API_DECLARE_NONSTD(int) 41 | apr_iconv_ces_open(const char *cesname, struct iconv_ces **cespp, apr_pool_t *ctx) 42 | { 43 | struct iconv_module *mod; 44 | struct iconv_ces *ces; 45 | apr_status_t error; 46 | 47 | error = apr_iconv_mod_load(cesname, ICMOD_UC_CES, NULL, &mod, ctx); 48 | if (APR_STATUS_IS_EFTYPE(error)) 49 | error = apr_iconv_mod_load("_tbl_simple", ICMOD_UC_CES, cesname, &mod, ctx); 50 | if (error != APR_SUCCESS) 51 | return (APR_STATUS_IS_EFTYPE(error)) ? APR_EINVAL : error; 52 | ces = malloc(sizeof(*ces)); 53 | if (ces == NULL) { 54 | apr_iconv_mod_unload(mod, ctx); 55 | return APR_ENOMEM; 56 | } 57 | memset(ces,0, sizeof(*ces)); 58 | ces->desc = (struct iconv_ces_desc*)mod->im_desc->imd_data; 59 | ces->data = mod->im_data; 60 | ces->mod = mod; 61 | error = ICONV_CES_OPEN(ces,ctx); 62 | if (error != APR_SUCCESS) { 63 | free(ces); 64 | apr_iconv_mod_unload(mod, ctx); 65 | return error; 66 | } 67 | *cespp = ces; 68 | return APR_SUCCESS; 69 | } 70 | 71 | API_DECLARE_NONSTD(int) 72 | apr_iconv_ces_close(struct iconv_ces *ces, apr_pool_t *ctx) 73 | { 74 | int res; 75 | 76 | if (ces == NULL) 77 | return -1; 78 | res = ICONV_CES_CLOSE(ces); 79 | if (ces->mod != NULL) 80 | apr_iconv_mod_unload(ces->mod, ctx); 81 | free(ces); 82 | return res; 83 | } 84 | 85 | API_DECLARE_NONSTD(int) 86 | apr_iconv_ces_open_func(struct iconv_ces *ces, apr_pool_t *ctx) 87 | { 88 | return iconv_malloc(sizeof(int), &ces->data); 89 | } 90 | 91 | API_DECLARE_NONSTD(int) 92 | apr_iconv_ces_close_func(struct iconv_ces *ces) 93 | { 94 | free(ces->data); 95 | return 0; 96 | } 97 | 98 | API_DECLARE_NONSTD(void) 99 | apr_iconv_ces_reset_func(struct iconv_ces *ces) 100 | { 101 | memset(ces->data, 0, sizeof(int)); 102 | } 103 | 104 | /*ARGSUSED*/ 105 | API_DECLARE_NONSTD(void) 106 | apr_iconv_ces_no_func(struct iconv_ces *ces) 107 | { 108 | } 109 | 110 | API_DECLARE_NONSTD(int) 111 | apr_iconv_ces_nbits7(struct iconv_ces *ces) 112 | { 113 | return 7; 114 | } 115 | 116 | API_DECLARE_NONSTD(int) 117 | apr_iconv_ces_nbits8(struct iconv_ces *ces) 118 | { 119 | return 8; 120 | } 121 | 122 | API_DECLARE_NONSTD(int) 123 | apr_iconv_ces_zero(struct iconv_ces *ces) 124 | { 125 | return 0; 126 | } 127 | -------------------------------------------------------------------------------- /lib/iconv_int.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999,2000 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v1.0 31 | */ 32 | 33 | #define ICONV_INTERNAL 34 | #include "iconv.h" 35 | 36 | #include /* tolower */ 37 | #include /* snprintf */ 38 | #include 39 | #include /* strdup, strlen */ 40 | 41 | apr_status_t 42 | iconv_malloc(apr_size_t size, void **pp) 43 | { 44 | void *p = malloc(size); 45 | 46 | if (p == NULL) 47 | return APR_ENOMEM; 48 | memset(p, 0, size); 49 | *pp = p; 50 | return APR_SUCCESS; 51 | } 52 | 53 | #ifdef ICONV_DEBUG 54 | #include /* va_end, va_list, va_start */ 55 | 56 | void iconv_debug(const char *file, int line, const char *function, 57 | const char *format, ...) 58 | { 59 | static char buffer[256]; 60 | va_list ap; 61 | va_start(ap, format); 62 | vsnprintf(buffer, sizeof(buffer), format, ap); 63 | fprintf(stderr, "%-14s[%3d]->%-14s: %s\n", file, line, function, buffer); 64 | fflush(stderr); 65 | va_end(ap); 66 | } 67 | #endif 68 | -------------------------------------------------------------------------------- /lib/iconv_uc.c: -------------------------------------------------------------------------------- 1 | #define ICONV_INTERNAL 2 | #include "iconv.h" 3 | 4 | #include 5 | #include 6 | 7 | struct iconv_uc { 8 | struct iconv_ces * from; 9 | struct iconv_ces * to; 10 | int ignore_ilseq; 11 | ucs_t missing; 12 | }; 13 | 14 | static iconv_open_t iconv_uc_open; 15 | static iconv_close_t iconv_uc_close; 16 | static iconv_conv_t iconv_uc_conv; 17 | 18 | struct iconv_converter_desc iconv_uc_desc = { 19 | iconv_uc_open, 20 | iconv_uc_close, 21 | iconv_uc_conv 22 | }; 23 | 24 | /* 25 | * It is call by apr_iconv_open: (*idesc)->icd_open() 26 | */ 27 | apr_status_t 28 | iconv_uc_open(const char *to, const char *from, void **data, apr_pool_t *ctx) 29 | { 30 | struct iconv_uc *ic; 31 | int error; 32 | 33 | ic = malloc(sizeof(*ic)); 34 | if (ic == NULL) 35 | return APR_ENOMEM; 36 | memset(ic, 0, sizeof(*ic)); 37 | error = apr_iconv_ces_open(from, &ic->from, ctx); 38 | if (error!=APR_SUCCESS) { 39 | goto bad; 40 | } 41 | error = apr_iconv_ces_open(to, &ic->to, ctx); 42 | if (error!=APR_SUCCESS) { 43 | goto bad; 44 | } 45 | ic->ignore_ilseq = 0; 46 | ic->missing = '_'; 47 | *data = (void*)ic; 48 | return APR_SUCCESS; 49 | bad: 50 | iconv_uc_close(ic,ctx); 51 | return error; 52 | } 53 | 54 | apr_status_t 55 | iconv_uc_close(void *data, apr_pool_t *ctx) 56 | { 57 | struct iconv_uc *ic = (struct iconv_uc *)data; 58 | 59 | if (ic == NULL) 60 | return APR_EBADF; 61 | if (ic->from) 62 | apr_iconv_ces_close(ic->from, ctx); 63 | if (ic->to) 64 | apr_iconv_ces_close(ic->to, ctx); 65 | free(ic); 66 | return APR_SUCCESS; 67 | } 68 | 69 | apr_status_t 70 | iconv_uc_conv(void *data, const unsigned char **inbuf, apr_size_t *inbytesleft, 71 | unsigned char **outbuf, apr_size_t *outbytesleft, apr_size_t *res) 72 | { 73 | struct iconv_uc *ic = (struct iconv_uc *)data; 74 | const unsigned char *ptr; 75 | ucs_t ch; 76 | apr_ssize_t size; 77 | 78 | *res = (apr_size_t)(0); 79 | if (data == NULL) { 80 | *res = (apr_size_t) -1; 81 | return APR_EBADF; 82 | } 83 | 84 | if (inbuf == NULL || *inbuf == NULL) { 85 | if (ICONV_CES_CONVERT_FROM_UCS(ic->to, UCS_CHAR_NONE, 86 | outbuf, outbytesleft) <= 0) { 87 | *res = (apr_size_t) -1; 88 | return APR_BADARG; /* too big */ 89 | } 90 | ICONV_CES_RESET(ic->from); 91 | ICONV_CES_RESET(ic->to); 92 | return APR_SUCCESS; 93 | } 94 | if (inbytesleft == NULL || *inbytesleft == 0) 95 | return APR_SUCCESS; 96 | while (*inbytesleft > 0 && *outbytesleft > 0) { 97 | ptr = *inbuf; 98 | ch = ICONV_CES_CONVERT_TO_UCS(ic->from, inbuf, inbytesleft); 99 | if (ch == UCS_CHAR_NONE) 100 | return APR_EINVAL; 101 | if (ch == UCS_CHAR_INVALID) { /* Invalid character in source buffer */ 102 | if (ic->ignore_ilseq) 103 | continue; 104 | *inbytesleft += *inbuf - ptr; 105 | *inbuf = ptr; 106 | return APR_BADCH; /* eilseq invalid */ 107 | } 108 | size = ICONV_CES_CONVERT_FROM_UCS(ic->to, ch, 109 | outbuf, outbytesleft); 110 | if (size < 0) { /* No equivalent in destination charset */ 111 | size = ICONV_CES_CONVERT_FROM_UCS(ic->to, ic->missing, 112 | outbuf, outbytesleft); 113 | if (size) 114 | (*res)++; 115 | } 116 | if (!size) { /* No space to write to */ 117 | *inbytesleft += *inbuf - ptr; 118 | *inbuf = ptr; 119 | return APR_BADARG; /* too big */ 120 | } 121 | } 122 | return APR_SUCCESS; 123 | } 124 | 125 | #if 0 126 | /* iconv_byteratio(cd) returns the byte ratio between OUTPUT and INPUT 127 | * stream lengths 128 | * -1: unknown 129 | * 0: 1/2 130 | * 1: 1/1 131 | * 2: 2/1 132 | */ 133 | int 134 | iconv_byteratio(apr_iconv_t cd) 135 | { 136 | iconv_data *idata = (iconv_data *)cd; 137 | int from, to; 138 | 139 | to = (*idata->to->data->nbytes)(idata->to); 140 | if (to == 0) 141 | return -1; 142 | from = (*idata->from->data->nbytes)(idata->from); 143 | return (from) ? to / from : -1; 144 | } 145 | #endif 146 | -------------------------------------------------------------------------------- /libapriconv.dep: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Generated Dependency File, included by libapriconv.mak 2 | 3 | .\lib\iconv.c : \ 4 | ".\include\apr_iconv.h"\ 5 | ".\lib\iconv.h"\ 6 | 7 | 8 | .\lib\iconv_ces.c : \ 9 | ".\include\apr_iconv.h"\ 10 | ".\lib\iconv.h"\ 11 | 12 | 13 | .\lib\iconv_ces_euc.c : \ 14 | ".\include\apr_iconv.h"\ 15 | ".\lib\iconv.h"\ 16 | 17 | 18 | .\lib\iconv_ces_iso2022.c : \ 19 | ".\include\apr_iconv.h"\ 20 | ".\lib\iconv.h"\ 21 | 22 | 23 | .\lib\iconv_int.c : \ 24 | ".\include\apr_iconv.h"\ 25 | ".\lib\iconv.h"\ 26 | 27 | 28 | .\lib\iconv_module.c : \ 29 | ".\include\api_version.h"\ 30 | ".\include\apr_iconv.h"\ 31 | ".\lib\charset_alias.h"\ 32 | ".\lib\iconv.h"\ 33 | 34 | 35 | .\lib\iconv_uc.c : \ 36 | ".\include\apr_iconv.h"\ 37 | ".\lib\iconv.h"\ 38 | 39 | 40 | .\libapriconv.rc : \ 41 | ".\include\api_version.h"\ 42 | ".\include\apr_iconv.h"\ 43 | 44 | -------------------------------------------------------------------------------- /libapriconv.rc: -------------------------------------------------------------------------------- 1 | #include "api_version.h" 2 | 3 | #define API_COPYRIGHT "Copyright 2000-2019 The Apache Software " \ 4 | "Foundation or its licensors, as applicable." 5 | 6 | #define API_LICENSE "Licensed under the Apache License, Version 2.0 " \ 7 | "(the ""License""); you may not use this file except " \ 8 | "in compliance with the License. You may obtain a " \ 9 | "copy of the License at\r\n\r\n" \ 10 | "http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n" \ 11 | "Unless required by applicable law or agreed to in " \ 12 | "writing, software distributed under the License is " \ 13 | "distributed on an ""AS IS"" BASIS, WITHOUT " \ 14 | "WARRANTIES OR CONDITIONS OF ANY KIND, either " \ 15 | "express or implied. See the License for the " \ 16 | "specific language governing permissions and " \ 17 | "limitations under the License." 18 | 19 | #define API_DLL_BASENAME "libapriconv-" API_STRINGIFY(API_MAJOR_VERSION) 20 | 21 | 22 | 1 VERSIONINFO 23 | FILEVERSION API_VERSION_STRING_CSV,0 24 | PRODUCTVERSION API_VERSION_STRING_CSV,0 25 | FILEFLAGSMASK 0x3fL 26 | #if defined(API_IS_DEV_VERSION) 27 | #if defined(_DEBUG) 28 | FILEFLAGS 0x03L 29 | #else 30 | FILEFLAGS 0x02L 31 | #endif 32 | #else 33 | #if defined(_DEBUG) 34 | FILEFLAGS 0x01L 35 | #else 36 | FILEFLAGS 0x00L 37 | #endif 38 | #endif 39 | #if defined(WINNT) || defined(WIN64) 40 | FILEOS 0x40004L 41 | #else 42 | FILEOS 0x4L 43 | #endif 44 | FILETYPE 0x2L 45 | FILESUBTYPE 0x0L 46 | BEGIN 47 | BLOCK "StringFileInfo" 48 | BEGIN 49 | BLOCK "040904b0" 50 | BEGIN 51 | VALUE "Comments", API_LICENSE "\0" 52 | VALUE "CompanyName", "Apache Software Foundation\0" 53 | VALUE "FileDescription", "Apache Portable Runtime Library\0" 54 | VALUE "FileVersion", API_VERSION_STRING "\0" 55 | VALUE "InternalName", API_DLL_BASENAME "\0" 56 | VALUE "LegalCopyright", API_COPYRIGHT "\0" 57 | VALUE "OriginalFilename", API_DLL_BASENAME ".dll\0" 58 | VALUE "ProductName", "Apache Portable Runtime Project\0" 59 | VALUE "ProductVersion", API_VERSION_STRING "\0" 60 | END 61 | END 62 | BLOCK "VarFileInfo" 63 | BEGIN 64 | VALUE "Translation", 0x409, 1200 65 | END 66 | END 67 | -------------------------------------------------------------------------------- /util/Makefile.in: -------------------------------------------------------------------------------- 1 | VPATH = @srcdir@ 2 | INCLUDES = @API_INCLUDES@ @APR_INCLUDES@ 3 | 4 | PROGRAMS = apriconv 5 | TARGETS = $(PROGRAMS) 6 | 7 | # bring in rules.mk for standard functionality 8 | @INCLUDE_RULES@ 9 | 10 | iconv_OBJECTS = iconv.lo iconv_stream.lo 11 | iconv_LDADD = ../lib/lib@API_LIBNAME@.la 12 | APR_LIBS = @APR_LIBS@ 13 | 14 | apriconv: $(iconv_OBJECTS) $(iconv_LDADD) 15 | $(LINK) $(iconv_OBJECTS) $(iconv_LDADD) $(LIBS) $(APR_LIBS) 16 | -------------------------------------------------------------------------------- /util/iconv.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999 3 | * Konstantin Chuguev. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Konstantin Chuguev 16 | * and its contributors. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | * SUCH DAMAGE. 29 | * 30 | * iconv (Charset Conversion Library) v0.3 31 | */ 32 | 33 | #include "apr.h" 34 | #include "apr_getopt.h" 35 | 36 | #include "api_version.h" 37 | 38 | #include /* va_end, va_list, va_start */ 39 | #include /* FILE, fclose, ferror, fopen, fread, stdin, 40 | vfprintf */ 41 | #include /* exit */ 42 | #include /* getopt */ 43 | 44 | #include "iconv_stream.h" 45 | 46 | static void 47 | convert_stream(FILE *in, iconv_stream *out) 48 | { 49 | static char buffer[4096]; 50 | apr_size_t size; 51 | 52 | while ((size = fread(buffer, 1, sizeof(buffer), in))) { 53 | if (iconv_bwrite(out, buffer, size) <= 0) { 54 | fprintf(stderr, "convert_stream: conversion stream writing error\n"); 55 | exit(2); 56 | } 57 | } 58 | if (ferror(in)) { 59 | fprintf(stderr, "convert_stream: input file reading error\n"); 60 | exit(1); 61 | } 62 | } 63 | 64 | static void 65 | convert_file(const char *name, iconv_stream *is) 66 | { 67 | int std = (name[0] == '-' && name[1] == '\0'); 68 | FILE *fp = std ? stdin : fopen(name, "r"); 69 | 70 | if (fp == NULL) { 71 | fprintf(stderr, "cannot open file %s\n", name); 72 | return; 73 | } 74 | convert_stream(fp, is); 75 | if (!std) 76 | fclose(fp); 77 | } 78 | 79 | static void closeapr(void) 80 | { 81 | apr_terminate(); 82 | } 83 | 84 | int 85 | main(int argc, const char **argv) 86 | { 87 | apr_iconv_t cd; 88 | iconv_stream *is; 89 | const char *from = NULL, *to = NULL, *input = NULL; 90 | char opt; 91 | apr_pool_t *ctx; 92 | apr_status_t status; 93 | apr_getopt_t *options; 94 | const char *opt_arg; 95 | 96 | /* Initialize APR */ 97 | apr_initialize(); 98 | atexit(closeapr); 99 | if (apr_pool_create(&ctx, NULL) != APR_SUCCESS) { 100 | fprintf(stderr, "Couldn't allocate context.\n"); 101 | exit(-1); 102 | } 103 | 104 | apr_getopt_init(&options, ctx, argc, argv); 105 | 106 | status = apr_getopt(options, "f:s:t:v", &opt, &opt_arg); 107 | 108 | while (status == APR_SUCCESS) { 109 | switch (opt) { 110 | case 'f': 111 | from = opt_arg; 112 | break; 113 | case 't': 114 | to = opt_arg; 115 | break; 116 | case 's': 117 | input = opt_arg; 118 | break; 119 | case 'v': 120 | fprintf(stderr, "APR-iconv version " API_VERSION_STRING "\n"); 121 | exit(0); 122 | default: 123 | fprintf(stderr, "Usage: iconv -f -t [-s ]\n"); 124 | exit(3); 125 | } 126 | 127 | status = apr_getopt(options, "f:s:t:v",&opt, &opt_arg); 128 | } 129 | 130 | if (status == APR_BADCH || status == APR_BADARG) { 131 | fprintf(stderr, "Usage: iconv -f -t [-s ]\n"); 132 | exit(3); 133 | } 134 | if (from == NULL) { 135 | fprintf(stderr, "missing source charset (-f )\n"); 136 | exit(4); 137 | } 138 | if (to == NULL) { 139 | fprintf(stderr, "missing destination charset (-t )\n"); 140 | exit(5); 141 | } 142 | 143 | /* Use it */ 144 | status = apr_iconv_open(to, from, ctx, &cd); 145 | if (status) { 146 | fprintf(stderr, "unable to open specified converter\n"); 147 | exit(6); 148 | } 149 | if (!(is = iconv_ostream_fopen(cd, stdout))) { 150 | apr_iconv_close(cd,ctx); 151 | exit(7); 152 | } 153 | if (input) { 154 | if (iconv_bwrite(is, input, strlen(input)) <= 0) 155 | exit(8); 156 | } else if (options->ind < options->argc) { 157 | for (opt = options->ind; opt < options->argc; opt ++) 158 | convert_file(options->argv[opt], is); 159 | } else 160 | convert_file("-", is); 161 | if (iconv_write(is, NULL, 0) < 0) 162 | exit(9); 163 | iconv_stream_close(is); 164 | apr_iconv_close(cd,ctx); 165 | return 0; 166 | } 167 | -------------------------------------------------------------------------------- /util/iconv_stream.h: -------------------------------------------------------------------------------- 1 | #ifndef _ICONV_STREAM_H_ 2 | #define _ICONV_STREAM_H_ 3 | 4 | #include /* FILE */ 5 | #include "iconv.h" /* iconv_t */ 6 | 7 | typedef apr_ssize_t (*iconv_stream_func)(void *d, void *buf, apr_size_t nbytes); 8 | 9 | typedef struct { 10 | apr_iconv_t cd; 11 | apr_size_t chars; 12 | apr_size_t in_bytes; 13 | apr_size_t out_bytes; 14 | char * buffer; 15 | char * buf_ptr; 16 | void * handle; 17 | iconv_stream_func method; 18 | } iconv_stream; 19 | 20 | iconv_stream *iconv_stream_open(apr_iconv_t cd, void *handle, 21 | iconv_stream_func method); 22 | void iconv_stream_close(iconv_stream *stream); 23 | 24 | iconv_stream *iconv_ostream_fopen(apr_iconv_t cd, FILE *handle); 25 | 26 | apr_ssize_t iconv_write(void *stream, const void *buf, apr_size_t nbytes); 27 | apr_ssize_t iconv_bwrite(void *stream, const void *buf, apr_size_t nbytes); 28 | 29 | #endif /*_ICONV_STREAM_H_*/ 30 | --------------------------------------------------------------------------------