├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .gitmodules ├── ABOUT-NLS ├── AUTHORS ├── COPYING ├── COPYING.LIB ├── ChangeLog ├── DEPENDENCIES ├── DESIGN ├── HACKING ├── INSTALL.generic ├── INSTALL.windows ├── Makefile.devel ├── Makefile.in ├── NEWS ├── NOTES ├── README ├── README.markdown ├── SMP ├── .gitattributes ├── .gitignore ├── SMP.patch ├── appveyor.yml ├── config.h ├── iconv.h ├── lib │ ├── aliases.h │ ├── aliases_dos.h │ ├── canonical.h │ ├── canonical_dos.h │ ├── canonical_local.h │ ├── flags.h │ └── translit.h ├── libiconv.sln ├── libiconv.vcxproj ├── libiconv.vcxproj.filters ├── libiconv_files.props ├── libiconv_winrt.vcxproj ├── libiconv_winrt.vcxproj.filters ├── libiconv_with_latest_sdk.bat ├── localcharset.h ├── readme.txt ├── smp.props └── smp_winrt.props ├── THANKS ├── autogen.sh ├── build-aux ├── ltmain.sh └── mkinstalldirs ├── configure.ac ├── extras ├── ChangeLog ├── iconv_string.c └── iconv_string.h ├── gitsub.sh ├── gnulib-local ├── lib │ ├── alloca.in.h │ ├── error.h.diff │ ├── progname.h.diff │ ├── xalloc.h │ ├── xmalloc.c │ └── xstrdup.c ├── m4 │ └── alloca.m4 └── modules │ ├── libiconv-misc │ ├── mbstate │ └── xalloc ├── include ├── export.h └── iconv.h.in ├── lib ├── Makefile.in ├── aliases2.h ├── armscii_8.h ├── ascii.h ├── atarist.h ├── big5.h ├── big5_2003.h ├── big5hkscs1999.h ├── big5hkscs2001.h ├── big5hkscs2004.h ├── big5hkscs2008.h ├── c99.h ├── ces_big5.h ├── ces_gbk.h ├── cjk_variants.h ├── cns11643.h ├── cns11643_1.h ├── cns11643_15.h ├── cns11643_2.h ├── cns11643_3.h ├── cns11643_4.h ├── cns11643_4a.h ├── cns11643_4b.h ├── cns11643_5.h ├── cns11643_6.h ├── cns11643_7.h ├── cns11643_inv.h ├── config.h.in ├── converters.h ├── cp1046.h ├── cp1124.h ├── cp1125.h ├── cp1129.h ├── cp1131.h ├── cp1133.h ├── cp1161.h ├── cp1162.h ├── cp1163.h ├── cp1250.h ├── cp1251.h ├── cp1252.h ├── cp1253.h ├── cp1254.h ├── cp1255.h ├── cp1256.h ├── cp1257.h ├── cp1258.h ├── cp437.h ├── cp50221_0208_ext.h ├── cp50221_0212_ext.h ├── cp737.h ├── cp775.h ├── cp850.h ├── cp852.h ├── cp853.h ├── cp855.h ├── cp856.h ├── cp857.h ├── cp858.h ├── cp860.h ├── cp861.h ├── cp862.h ├── cp863.h ├── cp864.h ├── cp865.h ├── cp866.h ├── cp869.h ├── cp874.h ├── cp922.h ├── cp932.h ├── cp932ext.h ├── cp936.h ├── cp936ext.h ├── cp943.h ├── cp949.h ├── cp950.h ├── cp950ext.h ├── dec_hanyu.h ├── dec_kanji.h ├── ebcdic037.h ├── ebcdic1025.h ├── ebcdic1026.h ├── ebcdic1047.h ├── ebcdic1097.h ├── ebcdic1112.h ├── ebcdic1122.h ├── ebcdic1123.h ├── ebcdic1130.h ├── ebcdic1132.h ├── ebcdic1137.h ├── ebcdic1140.h ├── ebcdic1141.h ├── ebcdic1142.h ├── ebcdic1143.h ├── ebcdic1144.h ├── ebcdic1145.h ├── ebcdic1146.h ├── ebcdic1147.h ├── ebcdic1148.h ├── ebcdic1149.h ├── ebcdic1153.h ├── ebcdic1154.h ├── ebcdic1155.h ├── ebcdic1156.h ├── ebcdic1157.h ├── ebcdic1158.h ├── ebcdic1160.h ├── ebcdic1164.h ├── ebcdic1165.h ├── ebcdic1166.h ├── ebcdic12712.h ├── ebcdic16804.h ├── ebcdic273.h ├── ebcdic277.h ├── ebcdic278.h ├── ebcdic280.h ├── ebcdic282.h ├── ebcdic284.h ├── ebcdic285.h ├── ebcdic297.h ├── ebcdic423.h ├── ebcdic424.h ├── ebcdic425.h ├── ebcdic4971.h ├── ebcdic500.h ├── ebcdic838.h ├── ebcdic870.h ├── ebcdic871.h ├── ebcdic875.h ├── ebcdic880.h ├── ebcdic905.h ├── ebcdic924.h ├── encodings.def ├── encodings_aix.def ├── encodings_dos.def ├── encodings_extra.def ├── encodings_local.def ├── encodings_osf1.def ├── encodings_zos.def ├── euc_cn.h ├── euc_jisx0213.h ├── euc_jp.h ├── euc_kr.h ├── euc_tw.h ├── flushwc.h ├── gb12345.h ├── gb12345ext.h ├── gb18030.h ├── gb18030ext.h ├── gb18030uni.h ├── gb2312.h ├── gbk.h ├── gbkext1.h ├── gbkext2.h ├── gbkext_inv.h ├── genaliases.c ├── genaliases2.c ├── genflags.c ├── gentranslit.c ├── georgian_academy.h ├── georgian_ps.h ├── hkscs1999.h ├── hkscs2001.h ├── hkscs2004.h ├── hkscs2008.h ├── hp_roman8.h ├── hz.h ├── iconv.c ├── iconv_open1.h ├── iconv_open2.h ├── iso2022_cn.h ├── iso2022_cnext.h ├── iso2022_jp.h ├── iso2022_jp1.h ├── iso2022_jp2.h ├── iso2022_jp3.h ├── iso2022_jpms.h ├── iso2022_kr.h ├── iso646_cn.h ├── iso646_jp.h ├── iso8859_1.h ├── iso8859_10.h ├── iso8859_11.h ├── iso8859_13.h ├── iso8859_14.h ├── iso8859_15.h ├── iso8859_16.h ├── iso8859_2.h ├── iso8859_3.h ├── iso8859_4.h ├── iso8859_5.h ├── iso8859_6.h ├── iso8859_7.h ├── iso8859_8.h ├── iso8859_9.h ├── isoir165.h ├── isoir165ext.h ├── java.h ├── jisx0201.h ├── jisx0208.h ├── jisx0212.h ├── jisx0213.h ├── johab.h ├── johab_hangul.h ├── koi8_r.h ├── koi8_ru.h ├── koi8_t.h ├── koi8_u.h ├── ksc5601.h ├── loop_unicode.h ├── loop_wchar.h ├── loops.h ├── mac_arabic.h ├── mac_centraleurope.h ├── mac_croatian.h ├── mac_cyrillic.h ├── mac_greek.h ├── mac_hebrew.h ├── mac_iceland.h ├── mac_roman.h ├── mac_romania.h ├── mac_thai.h ├── mac_turkish.h ├── mac_ukraine.h ├── mulelao.h ├── nextstep.h ├── pt154.h ├── relocatable.c ├── relocatable.h ├── riscos1.h ├── rk1048.h ├── shift_jisx0213.h ├── sjis.h ├── tcvn.h ├── tds565.h ├── tis620.h ├── translit.def ├── ucs2.h ├── ucs2be.h ├── ucs2internal.h ├── ucs2le.h ├── ucs2swapped.h ├── ucs4.h ├── ucs4be.h ├── ucs4internal.h ├── ucs4le.h ├── ucs4swapped.h ├── uhc_1.h ├── uhc_2.h ├── utf16.h ├── utf16be.h ├── utf16le.h ├── utf32.h ├── utf32be.h ├── utf32le.h ├── utf7.h ├── utf8.h ├── vietcomb.h └── viscii.h ├── libcharset ├── AUTHORS ├── COPYING.LIB ├── ChangeLog ├── DEPENDENCIES ├── HACKING ├── INSTALL.windows ├── INTEGRATE ├── Makefile.devel ├── Makefile.in ├── NEWS ├── README ├── autogen.sh ├── build-aux │ └── ltmain.sh ├── configure.ac ├── include │ ├── export.h │ ├── libcharset.h.in │ └── localcharset.h.in ├── lib │ ├── ChangeLog │ ├── Makefile.in │ ├── localcharset.c │ └── relocatable-stub.c ├── m4 │ ├── libtool.m4 │ ├── ltoptions.m4 │ ├── ltsugar.m4 │ ├── ltversion.m4 │ └── lt~obsolete.m4 └── tools │ ├── README │ ├── aix-3.2.5 │ ├── aix-4.1.5 │ ├── aix-4.2.0 │ ├── aix-4.3.2 │ ├── all-charsets │ ├── all-charsets-X11 │ ├── all-locales │ ├── beos-5 │ ├── cygwin-1.7.2 │ ├── darwin-6.8 │ ├── darwin-7.5 │ ├── darwin-9.5 │ ├── freebsd-3.3 │ ├── glibc-2.1.3 │ ├── glibc-2.1.90 │ ├── glibc-2.2 │ ├── glibc-2.2-XF86-3.3.6 │ ├── glibc-2.2-XF86-4.0.1f │ ├── hpux-10.01 │ ├── hpux-10.20 │ ├── hpux-11.00 │ ├── irix-6.5 │ ├── locale_charmap │ ├── locale_charset.c │ ├── locale_codeset.c │ ├── locale_monthnames.c │ ├── locale_x11encoding.c │ ├── netbsd-3.0 │ ├── openbsd-4.1 │ ├── osf1-4.0a │ ├── osf1-4.0d │ ├── osf1-5.1 │ ├── solaris-2.4 │ ├── solaris-2.5.1 │ ├── solaris-2.6 │ ├── solaris-2.6-cjk │ ├── solaris-2.7 │ ├── sunos-4.1.4 │ └── win32 ├── m4 ├── cp.m4 ├── eilseq.m4 ├── general.m4 ├── libtool.m4 ├── ln.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 ├── lt~obsolete.m4 └── proto.m4 ├── man ├── Makefile.in ├── iconv.1 ├── iconv.3 ├── iconv_close.3 ├── iconv_open.3 ├── iconv_open_into.3 └── iconvctl.3 ├── os2 └── iconv.def ├── po ├── ChangeLog ├── LINGUAS ├── Makefile.in.in ├── Makevars ├── POTFILES.in ├── Rules-quot ├── af.po ├── bg.po ├── boldquot.sed ├── ca.po ├── cs.po ├── da.po ├── de.po ├── el.po ├── en@boldquot.header ├── en@quot.header ├── eo.po ├── es.po ├── et.po ├── fi.po ├── fr.po ├── ga.po ├── gl.po ├── hr.po ├── hu.po ├── id.po ├── insert-header.sin ├── it.po ├── ja.po ├── ko.po ├── libiconv.pot ├── lt.po ├── nl.po ├── pl.po ├── pt_BR.po ├── quot.sed ├── remove-potcdate.sin ├── rm.po ├── ro.po ├── ru.po ├── sk.po ├── sl.po ├── sq.po ├── sr.po ├── sv.po ├── tr.po ├── uk.po ├── vi.po ├── wa.po ├── zh_CN.po └── zh_TW.po ├── src ├── Makefile.in ├── iconv.c └── iconv_no_i18n.c ├── srclib └── Makefile.am ├── tests ├── ARMSCII-8.IRREVERSIBLE.TXT ├── ARMSCII-8.TXT ├── ASCII.TXT ├── ATARIST.TXT ├── BIG5-2003.IRREVERSIBLE.TXT ├── BIG5-2003.TXT ├── BIG5-HKSCS-1999-snippet ├── BIG5-HKSCS-1999-snippet.UTF-8 ├── BIG5-HKSCS-1999.IRREVERSIBLE.TXT ├── BIG5-HKSCS-1999.TXT ├── BIG5-HKSCS-2001-snippet ├── BIG5-HKSCS-2001-snippet.UTF-8 ├── BIG5-HKSCS-2001.IRREVERSIBLE.TXT ├── BIG5-HKSCS-2001.TXT ├── BIG5-HKSCS-2004-snippet ├── BIG5-HKSCS-2004-snippet.UTF-8 ├── BIG5-HKSCS-2004.IRREVERSIBLE.TXT ├── BIG5-HKSCS-2004.TXT ├── BIG5-HKSCS-2008-snippet ├── BIG5-HKSCS-2008-snippet.UTF-8 ├── BIG5-HKSCS-2008.IRREVERSIBLE.TXT ├── BIG5-HKSCS-2008.TXT ├── BIG5.TXT ├── CP1046.TXT ├── CP1124.TXT ├── CP1125.TXT ├── CP1129.TXT ├── CP1131.TXT ├── CP1133.TXT ├── CP1161.IRREVERSIBLE.TXT ├── CP1161.TXT ├── CP1162.TXT ├── CP1163.IRREVERSIBLE.TXT ├── CP1163.TXT ├── CP1250.TXT ├── CP1251.TXT ├── CP1252.TXT ├── CP1253.TXT ├── CP1254.TXT ├── CP1255-snippet ├── CP1255-snippet.UTF-8 ├── CP1255.IRREVERSIBLE.TXT ├── CP1255.TXT ├── CP1256.TXT ├── CP1257.TXT ├── CP1258-snippet ├── CP1258-snippet.UTF-8 ├── CP1258.IRREVERSIBLE.TXT ├── CP1258.TXT ├── CP437.TXT ├── CP737.TXT ├── CP775.TXT ├── CP850.TXT ├── CP852.TXT ├── CP853.TXT ├── CP855.TXT ├── CP856.TXT ├── CP857.TXT ├── CP858.TXT ├── CP860.TXT ├── CP861.TXT ├── CP862.TXT ├── CP863.TXT ├── CP864.TXT ├── CP865.TXT ├── CP866.TXT ├── CP869.TXT ├── CP874.TXT ├── CP922.TXT ├── CP932.IRREVERSIBLE.TXT ├── CP932.TXT ├── CP936.TXT ├── CP949.TXT ├── CP950.IRREVERSIBLE.TXT ├── CP950.TXT ├── DEC-HANYU.IRREVERSIBLE.TXT ├── DEC-HANYU.TXT ├── DEC-KANJI.TXT ├── EUC-CN.TXT ├── EUC-JISX0213.TXT ├── EUC-JP.IRREVERSIBLE.TXT ├── EUC-JP.TXT ├── EUC-KR.TXT ├── EUC-TW.IRREVERSIBLE.TXT ├── EUC-TW.TXT ├── GB18030-BMP.TXT ├── GB18030.IRREVERSIBLE.TXT ├── GBK.TXT ├── Georgian-Academy.TXT ├── Georgian-PS.TXT ├── HP-ROMAN8.TXT ├── HZ-snippet ├── HZ-snippet.UTF-8 ├── IBM-037.TXT ├── IBM-1025.TXT ├── IBM-1026.TXT ├── IBM-1047.TXT ├── IBM-1097.TXT ├── IBM-1112.TXT ├── IBM-1122.TXT ├── IBM-1123.TXT ├── IBM-1130.TXT ├── IBM-1132.TXT ├── IBM-1137.TXT ├── IBM-1140.TXT ├── IBM-1141.TXT ├── IBM-1142.TXT ├── IBM-1143.TXT ├── IBM-1144.TXT ├── IBM-1145.TXT ├── IBM-1146.TXT ├── IBM-1147.TXT ├── IBM-1148.TXT ├── IBM-1149.TXT ├── IBM-1153.TXT ├── IBM-1154.TXT ├── IBM-1155.TXT ├── IBM-1156.TXT ├── IBM-1157.TXT ├── IBM-1158.TXT ├── IBM-1160.IRREVERSIBLE.TXT ├── IBM-1160.TXT ├── IBM-1164.TXT ├── IBM-1165.TXT ├── IBM-1166.TXT ├── IBM-12712.TXT ├── IBM-16804.TXT ├── IBM-273.TXT ├── IBM-277.TXT ├── IBM-278.TXT ├── IBM-280.TXT ├── IBM-282.TXT ├── IBM-284.TXT ├── IBM-285.TXT ├── IBM-297.TXT ├── IBM-423.TXT ├── IBM-424.TXT ├── IBM-425.TXT ├── IBM-4971.TXT ├── IBM-500.TXT ├── IBM-838.IRREVERSIBLE.TXT ├── IBM-838.TXT ├── IBM-870.TXT ├── IBM-871.TXT ├── IBM-875.TXT ├── IBM-880.TXT ├── IBM-905.TXT ├── IBM-924.TXT ├── ISO-2022-CN-EXT-snippet ├── ISO-2022-CN-EXT-snippet.UTF-8 ├── ISO-2022-CN-snippet ├── ISO-2022-CN-snippet.UTF-8 ├── ISO-2022-JP-1-snippet ├── ISO-2022-JP-1-snippet.UTF-8 ├── ISO-2022-JP-2-snippet ├── ISO-2022-JP-2-snippet.UTF-8 ├── ISO-2022-JP-3-snippet ├── ISO-2022-JP-3-snippet.UTF-8 ├── ISO-2022-JP-MS-snippet ├── ISO-2022-JP-MS-snippet.UTF-8 ├── ISO-2022-JP-MS-snippet.alt ├── ISO-2022-JP-snippet ├── ISO-2022-JP-snippet.UTF-8 ├── ISO-2022-KR-snippet ├── ISO-2022-KR-snippet.UTF-8 ├── ISO-8859-1.TXT ├── ISO-8859-10.TXT ├── ISO-8859-11.TXT ├── ISO-8859-13.TXT ├── ISO-8859-14.TXT ├── ISO-8859-15.TXT ├── ISO-8859-16.TXT ├── ISO-8859-2.TXT ├── ISO-8859-3.TXT ├── ISO-8859-4.TXT ├── ISO-8859-5.TXT ├── ISO-8859-6.TXT ├── ISO-8859-7.TXT ├── ISO-8859-8.TXT ├── ISO-8859-9.TXT ├── ISO-IR-165.IRREVERSIBLE.TXT ├── ISO-IR-165.TXT ├── ISO646-CN.TXT ├── ISO646-JP.TXT ├── JIS_X0201.TXT ├── JOHAB.TXT ├── KOI8-R.TXT ├── KOI8-RU.TXT ├── KOI8-T.TXT ├── KOI8-U.TXT ├── MacArabic.TXT ├── MacCentralEurope.TXT ├── MacCroatian.TXT ├── MacCyrillic.TXT ├── MacGreek.TXT ├── MacHebrew.TXT ├── MacIceland.TXT ├── MacRoman.TXT ├── MacRomania.TXT ├── MacThai.TXT ├── MacTurkish.TXT ├── MacUkraine.TXT ├── Makefile.in ├── MuleLao-1.TXT ├── NEXTSTEP.TXT ├── PT154.TXT ├── Quotes.ASCII ├── Quotes.ISO-8859-1 ├── Quotes.UTF-8 ├── RISCOS-LATIN1.TXT ├── RK1048.TXT ├── SHIFT_JIS.TXT ├── SHIFT_JISX0213.TXT ├── TCVN-snippet ├── TCVN-snippet.UTF-8 ├── TCVN.IRREVERSIBLE.TXT ├── TCVN.TXT ├── TDS565.TXT ├── TIS-620.TXT ├── Translit1.ASCII ├── Translit1.ISO-8859-1 ├── TranslitFail1.ISO-8859-1 ├── UCS-2BE-snippet ├── UCS-2BE-snippet.UTF-8 ├── UCS-2LE-snippet ├── UCS-2LE-snippet.UTF-8 ├── UCS-4BE-snippet ├── UCS-4BE-snippet.UTF-8 ├── UCS-4LE-snippet ├── UCS-4LE-snippet.UTF-8 ├── UTF-16-snippet ├── UTF-16-snippet.UTF-8 ├── UTF-16BE-snippet ├── UTF-16BE-snippet.UTF-8 ├── UTF-16LE-snippet ├── UTF-16LE-snippet.UTF-8 ├── UTF-32-snippet ├── UTF-32-snippet.UTF-8 ├── UTF-32BE-snippet ├── UTF-32BE-snippet.UTF-8 ├── UTF-32LE-snippet ├── UTF-32LE-snippet.UTF-8 ├── UTF-7-snippet ├── UTF-7-snippet.UTF-8 ├── VISCII.TXT ├── check-stateful ├── check-stateful.bat ├── check-stateless ├── check-stateless.bat ├── check-subst ├── check-translit ├── check-translit.bat ├── check-translitfailure ├── gengb18030z.c ├── genutf8.c ├── is-native.c ├── table-from.c ├── table-to.c ├── test-shiftseq.c ├── test-to-wchar.c └── uniq-u.c ├── tools ├── 8bit_tab_to_h.c ├── CP50221-0208-EXT.TXT ├── CP50221-0212-EXT.TXT ├── JISX0213.TXT ├── Makefile ├── cjk_tab_to_h.c └── cjk_variants.c ├── windows ├── iconv.rc ├── libiconv.rc └── windres-options └── woe32dll ├── export.h └── iconv-exports.c /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Context 4 | 5 | 6 | ## Expected Behavior 7 | 8 | 9 | ## Actual Behavior 10 | 11 | 12 | ## Steps to Reproduce 13 | 14 | 1. 15 | 2. 16 | 3. 17 | 4. 18 | 19 | ## Your Environment 20 | 21 | * Version Used: 22 | * Operating System and Version: 23 | * Compiler and Version(s): 24 | 25 | ## Possible Fix 26 | 27 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Context 4 | 5 | 6 | ## Current and Suggested Behavior 7 | 8 | 9 | ## Steps to Explain Enhancement 10 | 11 | 1. 12 | 2. 13 | 3. 14 | 4. 15 | 16 | ## Your Test Environment 17 | 18 | * Version Used: 19 | * Operating System and Version(s): 20 | * Compiler and version(s): -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [subcheckout "gnulib"] 2 | url = git://git.savannah.gnu.org/gnulib.git 3 | path = gnulib 4 | -------------------------------------------------------------------------------- /ABOUT-NLS: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Bruno Haible 2 | -------------------------------------------------------------------------------- /DEPENDENCIES: -------------------------------------------------------------------------------- 1 | The following packages should be installed before GNU libiconv is installed 2 | (runtime dependencies that are also build dependencies): 3 | 4 | None. 5 | 6 | 7 | The following packages should be installed when GNU libiconv is installed 8 | (runtime dependencies, but not build dependencies): 9 | 10 | None. 11 | 12 | 13 | The following should be installed when GNU libiconv is built, but are not 14 | needed later, once it is installed (build dependencies, but not runtime 15 | dependencies): 16 | 17 | * A C runtime, compiler, linker, etc. 18 | + Mandatory. 19 | Either the platform's native 'cc', or GCC 3.1 or newer. 20 | + GCC Homepage: 21 | https://gcc.gnu.org/ 22 | + Download: 23 | https://ftp.gnu.org/gnu/gcc/ 24 | 25 | * A 'make' utility. 26 | + Mandatory. 27 | Either the platform's native 'make' (for in-tree builds only), 28 | or GNU Make 3.79.1 or newer. 29 | + GNU Make Homepage: 30 | https://www.gnu.org/software/make/ 31 | + Download: 32 | https://ftp.gnu.org/gnu/make/ 33 | 34 | * A shell 35 | + Mandatory. 36 | Either the platform's native 'sh', or Bash. 37 | + Homepage: 38 | https://www.gnu.org/software/bash/ 39 | + Download: 40 | https://ftp.gnu.org/gnu/bash/ 41 | 42 | * Core POSIX utilities, including: 43 | [ basename cat chgrp chmod chown cp dd echo expand expr 44 | false hostname install kill ln ls md5sum mkdir mkfifo 45 | mknod mv printenv pwd rm rmdir sleep sort tee test touch 46 | true uname 47 | + Mandatory. 48 | Either the platform's native utilities, or GNU coreutils. 49 | + Homepage: 50 | https://www.gnu.org/software/coreutils/ 51 | + Download: 52 | https://ftp.gnu.org/gnu/coreutils/ 53 | 54 | * The comparison utilities 'cmp' and 'diff'. 55 | + Mandatory. 56 | Either the platform's native utilities, or GNU diffutils. 57 | + Homepage: 58 | https://www.gnu.org/software/diffutils/ 59 | + Download: 60 | https://ftp.gnu.org/gnu/diffutils/ 61 | 62 | * Grep. 63 | + Mandatory. 64 | Either the platform's native grep, or GNU grep. 65 | + Homepage: 66 | https://www.gnu.org/software/grep/ 67 | + Download: 68 | https://ftp.gnu.org/gnu/grep/ 69 | 70 | * Awk. 71 | + Mandatory. 72 | Either the platform's native awk, mawk, or nawk, or GNU awk. 73 | + Homepage: 74 | https://www.gnu.org/software/gawk/ 75 | + Download: 76 | https://ftp.gnu.org/gnu/gawk/ 77 | -------------------------------------------------------------------------------- /HACKING: -------------------------------------------------------------------------------- 1 | All you need to know when hacking (modifying) GNU libiconv or when building 2 | it off the Git repository. 3 | 4 | 5 | Requirements 6 | ============ 7 | 8 | You will need reasonably recent versions of the build tools: 9 | 10 | * A C compiler. Such as GNU GCC. 11 | + Homepage: 12 | https://gcc.gnu.org/ 13 | 14 | * GNU automake 1.16.x 15 | + Homepage: 16 | https://www.gnu.org/software/automake/ 17 | 18 | * GNU autoconf 2.69 or newer 19 | + Homepage: 20 | https://www.gnu.org/software/autoconf/ 21 | 22 | * GNU m4 23 | + Homepage: 24 | https://www.gnu.org/software/m4/ 25 | 26 | * GNU gperf 27 | + Homepage: 28 | https://www.gnu.org/software/gperf/ 29 | 30 | * GNU groff 1.17 or newer 31 | + Homepage: 32 | https://www.gnu.org/software/groff/ 33 | 34 | * Perl 35 | + Homepage: 36 | https://www.perl.org/ 37 | 38 | * Either an internet connection or a recent copy of GNU gnulib. 39 | + Homepage: 40 | https://www.gnu.org/software/gnulib/ 41 | 42 | And, of course, the packages listed in the DEPENDENCIES file. 43 | 44 | 45 | Building off the Git repository 46 | =============================== 47 | 48 | Access to the Git repository is described at 49 | https://savannah.gnu.org/git/?group=libiconv . 50 | 51 | After fetching the sources from the Git repository, peek at the comments in 52 | autogen.sh, then run 53 | ./gitsub.sh pull 54 | ./autogen.sh 55 | Then you can proceed with "./configure" as usual. 56 | 57 | Each time you want to update the source, do not only "git pull". Instead do 58 | git pull && ./gitsub.sh pull 59 | ./autogen.sh 60 | 61 | 62 | Adding new encodings 63 | ==================== 64 | 65 | For an indication which encodings are acceptable in the official version of 66 | GNU libiconv, take a look at NOTES. 67 | 68 | For an indication which files need to be modified when adding a new encoding, 69 | look for example at the 2007-05-25 ChangeLog entry for RK1048. The lib/*.h 70 | file for an encoding is usually generated by one of the tools in the tools/ 71 | directory. All you need to provide is the conversion table in the format of 72 | the many *.TXT files. 73 | -------------------------------------------------------------------------------- /SMP/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sln text eol=crlf 2 | *.vcxproj text eol=crlf 3 | *.vcxproj.filters text eol=crlf 4 | *.bat text eol=crlf -------------------------------------------------------------------------------- /SMP/.gitignore: -------------------------------------------------------------------------------- 1 | *.obj 2 | *.lib 3 | *.log 4 | *.tlog 5 | *.pdb 6 | *.ildb 7 | *.pgd 8 | *.pch 9 | *.manifest 10 | *.suo 11 | *.user 12 | *.sdf 13 | *.opensdf 14 | [Oo]bj/ 15 | *.exe 16 | !*.h 17 | !*.c 18 | !*.asm 19 | !*.def 20 | !*.rc 21 | *.sbr 22 | *.iobj 23 | *.ipdb 24 | .vs/ 25 | *.VC.db 26 | *.opendb 27 | *.ilk 28 | [Bb]in/ -------------------------------------------------------------------------------- /SMP/lib/aliases_dos.h: -------------------------------------------------------------------------------- 1 | S(dos_0, "CP437", ei_cp437 ) 2 | S(dos_1, "IBM437", ei_cp437 ) 3 | S(dos_2, "437", ei_cp437 ) 4 | S(dos_3, "CSPC8CODEPAGE437", ei_cp437 ) 5 | S(dos_4, "CP737", ei_cp737 ) 6 | S(dos_5, "CP775", ei_cp775 ) 7 | S(dos_6, "IBM775", ei_cp775 ) 8 | S(dos_7, "CSPC775BALTIC", ei_cp775 ) 9 | S(dos_8, "CP852", ei_cp852 ) 10 | S(dos_9, "IBM852", ei_cp852 ) 11 | S(dos_10, "852", ei_cp852 ) 12 | S(dos_11, "CSPCP852", ei_cp852 ) 13 | S(dos_12, "CP853", ei_cp853 ) 14 | S(dos_13, "CP855", ei_cp855 ) 15 | S(dos_14, "IBM855", ei_cp855 ) 16 | S(dos_15, "855", ei_cp855 ) 17 | S(dos_16, "CSIBM855", ei_cp855 ) 18 | S(dos_17, "CP857", ei_cp857 ) 19 | S(dos_18, "IBM857", ei_cp857 ) 20 | S(dos_19, "857", ei_cp857 ) 21 | S(dos_20, "CSIBM857", ei_cp857 ) 22 | S(dos_21, "CP858", ei_cp858 ) 23 | S(dos_22, "CP860", ei_cp860 ) 24 | S(dos_23, "IBM860", ei_cp860 ) 25 | S(dos_24, "860", ei_cp860 ) 26 | S(dos_25, "CSIBM860", ei_cp860 ) 27 | S(dos_26, "CP861", ei_cp861 ) 28 | S(dos_27, "IBM861", ei_cp861 ) 29 | S(dos_28, "861", ei_cp861 ) 30 | S(dos_29, "CP-IS", ei_cp861 ) 31 | S(dos_30, "CSIBM861", ei_cp861 ) 32 | S(dos_31, "CP863", ei_cp863 ) 33 | S(dos_32, "IBM863", ei_cp863 ) 34 | S(dos_33, "863", ei_cp863 ) 35 | S(dos_34, "CSIBM863", ei_cp863 ) 36 | S(dos_35, "CP864", ei_cp864 ) 37 | S(dos_36, "IBM864", ei_cp864 ) 38 | S(dos_37, "CSIBM864", ei_cp864 ) 39 | S(dos_38, "CP865", ei_cp865 ) 40 | S(dos_39, "IBM865", ei_cp865 ) 41 | S(dos_40, "865", ei_cp865 ) 42 | S(dos_41, "CSIBM865", ei_cp865 ) 43 | S(dos_42, "CP869", ei_cp869 ) 44 | S(dos_43, "IBM869", ei_cp869 ) 45 | S(dos_44, "869", ei_cp869 ) 46 | S(dos_45, "CP-GR", ei_cp869 ) 47 | S(dos_46, "CSIBM869", ei_cp869 ) 48 | S(dos_47, "CP1125", ei_cp1125 ) 49 | -------------------------------------------------------------------------------- /SMP/lib/canonical_dos.h: -------------------------------------------------------------------------------- 1 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_0, 2 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_4, 3 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_5, 4 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_8, 5 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_12, 6 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_13, 7 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_17, 8 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_21, 9 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_22, 10 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_26, 11 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_31, 12 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_35, 13 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_38, 14 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_42, 15 | (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_dos_47, 16 | -------------------------------------------------------------------------------- /SMP/lib/canonical_local.h: -------------------------------------------------------------------------------- 1 | (int)(intptr_t)&((struct stringpool_t *)0)->stringpool_str193, 2 | (int)(intptr_t)&((struct stringpool_t *)0)->stringpool_str496, 3 | -------------------------------------------------------------------------------- /SMP/libiconv_with_latest_sdk.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | SET PROJECT=libiconv 4 | 5 | @REM Detect the newest available Windows SDK 6 | CALL :GetWindowsSdkVer 7 | 8 | @REM Open the project 9 | %PROJECT%.sln 10 | 11 | EXIT /B 0 12 | 13 | :GetWindowsSdkVer 14 | SET WindowsTargetPlatformVersion= 15 | 16 | IF "%WindowsTargetPlatformVersion%"=="" CALL :GetWin10SdkVer 17 | IF "%WindowsTargetPlatformVersion%"=="" CALL :GetWin81SdkVer 18 | EXIT /B 0 19 | 20 | :GetWin10SdkVer 21 | CALL :GetWin10SdkVerHelper HKLM\SOFTWARE\Wow6432Node > nul 2>&1 22 | IF errorlevel 1 CALL :GetWin10SdkVerHelper HKCU\SOFTWARE\Wow6432Node > nul 2>&1 23 | IF errorlevel 1 CALL :GetWin10SdkVerHelper HKLM\SOFTWARE > nul 2>&1 24 | IF errorlevel 1 CALL :GetWin10SdkVerHelper HKCU\SOFTWARE > nul 2>&1 25 | IF errorlevel 1 EXIT /B 1 26 | EXIT /B 0 27 | 28 | :GetWin10SdkVerHelper 29 | @REM Get Windows 10 SDK installed folder 30 | FOR /F "tokens=1,2*" %%i IN ('reg query "%1\Microsoft\Microsoft SDKs\Windows\v10.0" /v "InstallationFolder"') DO ( 31 | IF "%%i"=="InstallationFolder" ( 32 | SET WindowsSdkDir=%%~k 33 | ) 34 | ) 35 | 36 | @REM get windows 10 sdk version number 37 | SETLOCAL enableDelayedExpansion 38 | IF NOT "%WindowsSdkDir%"=="" FOR /f %%i IN ('dir "%WindowsSdkDir%include\" /b /ad-h /on') DO ( 39 | @REM Skip if Windows.h is not found in %%i\um. This would indicate that only the UCRT MSIs were 40 | @REM installed for this Windows SDK version. 41 | IF EXIST "%WindowsSdkDir%include\%%i\um\Windows.h" ( 42 | SET result=%%i 43 | IF "!result:~0,3!"=="10." ( 44 | SET SDK=!result! 45 | IF "!result!"=="%VSCMD_ARG_WINSDK%" SET findSDK=1 46 | ) 47 | ) 48 | ) 49 | 50 | IF "%findSDK%"=="1" SET SDK=%VSCMD_ARG_WINSDK% 51 | ENDLOCAL & SET WindowsTargetPlatformVersion=%SDK% 52 | IF "%WindowsTargetPlatformVersion%"=="" ( 53 | EXIT /B 1 54 | ) 55 | EXIT /B 0 56 | 57 | :GetWin81SdkVer 58 | SET WindowsTargetPlatformVersion=8.1 59 | EXIT /B 0 60 | -------------------------------------------------------------------------------- /SMP/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | This is a small list of steps in order to build libiconv into a msvc dll and/or lib file. 3 | 4 | The project contains Release and Debug builds for static lib files (Debug/Release) 5 | as well as dynamic shared dll files (DebugDLL/ReleaseDLL). Along with the standard 6 | windows dll/lib configurations mentioned above there are also equivalent variants that 7 | can be used to compile for WinRT/UWP (These configurations have a WinRT suffix). 8 | There are also architecture configurations for either 32bit (x86) or 64bit (x64) compilation. 9 | Choose whichever project configuration meets your requirements. 10 | 11 | The project configurations support being built with various different windows SDK versions. 12 | By default they will use the lowest SDK version that would be available for Visual Studio 13 | version 2013 and up (This is the 8.1 SDK). However a batch file is also included 14 | (libiconv_with_latest_sdk.bat) which can be used to auto detect the newest available SDK 15 | installed on the host machine and then open the project using that as the compilation SDK. 16 | 17 | When using the WinRT/UWP project configurations the projects will automatically compile towards 18 | the default application target for the Version of Visual Studio being used: 19 | VS 2013: 8.1 20 | VS 2015: 8.1 21 | VS 2017+: 10.0.10240.0 22 | 23 | -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- 1 | Thanks to for 2 | 3 | Edmund Grimley Evans bug reports 4 | 5 | Taro Muraoka Woe32 DLL support 6 | 7 | Akira Hatakeyama OS/2 support 8 | 9 | Juan Manuel Guerrero 10 | DOS/DJGPP support 11 | 12 | Hironori Sakamoto advice on EUC-JP and JISX0213 13 | 14 | Ken Lunde detailed information about GB18030 15 | 16 | -------------------------------------------------------------------------------- /extras/ChangeLog: -------------------------------------------------------------------------------- 1 | 2011-06-04 Bruno Haible 2 | 3 | * iconv_string.c (iconv_string): Treat incomplete byte sequence like 4 | invalid byte sequence. 5 | Reported by shosas at . 6 | 7 | 2003-05-10 Bruno Haible 8 | 9 | * iconv_string.c (iconv_string): Don't return -1 just because the 10 | string is longer than 4 KB. 11 | 12 | 2002-02-13 Bruno Haible 13 | 14 | * iconv.m4: Remove file. Obsoleted by m4/iconv.m4. 15 | 16 | 2000-06-16 Bruno Haible 17 | 18 | * iconv.m4: Change prefix to AM. 19 | 20 | 2001-05-23 Bruno Haible 21 | 22 | * iconv.m4 (jm_ICONV): Accept --with-libiconv-prefix option. 23 | 24 | 2001-03-23 Bruno Haible 25 | 26 | * iconv.m4 (jm_ICONV): Tweak printing of prototype. 27 | 28 | 2001-03-20 Bruno Haible 29 | 30 | * iconv.m4 (jm_ICONV): Recommend GNU libiconv. 31 | 32 | 2001-01-03 Bruno Haible 33 | 34 | * iconv.m4 (jm_ICONV): Also check whether the iconv declaration 35 | has const. 36 | 37 | 2000-02-02 Bruno Haible 38 | 39 | * iconv.m4: New file. 40 | 41 | 2001-01-29 Bruno Haible 42 | 43 | * locale_charset.c: Remove file. Obsoleted by libcharset. 44 | 45 | 2000-10-22 Bruno Haible 46 | 47 | * locale_charset.c (get_locale_charset): Accept french and spanish 48 | names in both ISO-8859-1 and UTF-8. 49 | 50 | 2000-08-24 Jim Blackson 51 | 52 | * iconv_string.c (iconv_string): Fix return value for autodetect. 53 | 54 | 2000-01-24 Bruno Haible 55 | 56 | * iconv_string.c (iconv_string): Stop recognizing JOHAB. 57 | Fix typo for EUC-JP. 58 | 59 | 1999-12-18 Bruno Haible 60 | 61 | * locale_charset.c (get_locale_charset): Recognize more language codes: 62 | "af" (afrikaans), "ca" (catalan), "eu" (basque), "fo" (faeroese), 63 | "ga" (irish), "gd" (scottish), "gl" (galician), "sq" (albanian), 64 | "eo" (esperanto), "mt" (maltese), "be" (byelorussian), 65 | "et" (estonian), "lt" (lithuanian), "lv" (latvian), "uk" (ukrainian). 66 | Recognize more aliases: "english", "slovenian", "macedonian", 67 | "serbian", "arabic". 68 | Change default: KOI8-R for "ru" (russian) instead of ISO-8859-5, 69 | ISO-8859-5 for "sr" instead of ISO-8859-2. 70 | 71 | -------------------------------------------------------------------------------- /extras/iconv_string.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1999-2001 Bruno Haible. 2 | This file is not part of the GNU LIBICONV Library. 3 | This file is put into the public domain. */ 4 | 5 | /* 6 | * This C function converts an entire string from one encoding to another, 7 | * using iconv. Easier to use than iconv() itself, and supports autodetect 8 | * encodings on input. 9 | * 10 | * int iconv_string (const char* tocode, const char* fromcode, 11 | * const char* start, const char* end, 12 | * char** resultp, size_t* lengthp) 13 | * 14 | * Converts a memory region given in encoding FROMCODE to a new memory 15 | * region in encoding TOCODE. FROMCODE and TOCODE are as for iconv_open(3), 16 | * except that FROMCODE may be one of the values 17 | * "autodetect_utf8" supports ISO-8859-1 and UTF-8 18 | * "autodetect_jp" supports EUC-JP, ISO-2022-JP-2 and SHIFT_JIS 19 | * "autodetect_kr" supports EUC-KR and ISO-2022-KR 20 | * The input is in the memory region between start (inclusive) and end 21 | * (exclusive). If resultp is not NULL, the output string is stored in 22 | * *resultp; malloc/realloc is used to allocate the result. 23 | * 24 | * This function does not treat zero characters specially. 25 | * 26 | * Return value: 0 if successful, otherwise -1 and errno set. Particular 27 | * errno values: EILSEQ and ENOMEM. 28 | * 29 | * Example: 30 | * const char* s = ...; 31 | * char* result = NULL; 32 | * if (iconv_string("UCS-4-INTERNAL", "autodetect_utf8", 33 | * s, s+strlen(s)+1, &result, NULL) < 0) 34 | * perror("iconv_string"); 35 | * 36 | */ 37 | #include 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | extern int iconv_string (const char* tocode, const char* fromcode, const char* start, const char* end, char** resultp, size_t* lengthp); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | -------------------------------------------------------------------------------- /gnulib-local/lib/alloca.in.h: -------------------------------------------------------------------------------- 1 | /* Memory allocation on the stack. 2 | Copyright (C) 1995, 1999, 2001-2007 Free Software Foundation, Inc. 3 | 4 | This file is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as 6 | published by the Free Software Foundation; either version 2.1 of the 7 | License, or (at your option) any later version. 8 | 9 | This file is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program. If not, see . */ 16 | 17 | /* When this file is included, it may be preceded only by preprocessor 18 | declarations. Thanks to AIX. Therefore we include it right after 19 | "config.h", not later. */ 20 | 21 | /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H 22 | means there is a real alloca function. */ 23 | #ifndef _GL_ALLOCA_H 24 | #define _GL_ALLOCA_H 25 | 26 | /* alloca(N) returns a pointer (void* or char*) to N bytes of memory 27 | allocated on the stack, and which will last until the function returns. 28 | Use of alloca should be avoided: 29 | - inside arguments of function calls - undefined behaviour, 30 | - in inline functions - the allocation may actually last until the 31 | calling function returns, 32 | - for huge N (say, N >= 65536) - you never know how large (or small) 33 | the stack is, and when the stack cannot fulfill the memory allocation 34 | request, the program just crashes. 35 | */ 36 | 37 | #ifndef alloca 38 | # ifdef __GNUC__ 39 | # define alloca __builtin_alloca 40 | # else 41 | # ifdef _MSC_VER 42 | # include 43 | # define alloca _alloca 44 | # else 45 | # if HAVE_ALLOCA_H 46 | # include 47 | # else 48 | # ifdef _AIX 49 | #pragma alloca 50 | # else 51 | # ifdef __hpux /* This section must match that of bison generated files. */ 52 | # ifdef __cplusplus 53 | extern "C" void *alloca (unsigned int); 54 | # else /* not __cplusplus */ 55 | extern void *alloca (); 56 | # endif /* not __cplusplus */ 57 | # else /* not __hpux */ 58 | # ifndef alloca 59 | extern char *alloca (); 60 | # endif 61 | # endif /* __hpux */ 62 | # endif 63 | # endif 64 | # endif 65 | # endif 66 | #endif 67 | 68 | #endif /* _GL_ALLOCA_H */ 69 | -------------------------------------------------------------------------------- /gnulib-local/lib/error.h.diff: -------------------------------------------------------------------------------- 1 | *** gnulib/lib/error.h 2005-05-14 08:03:58.000000000 +0200 2 | --- srclib/error.h 2005-05-20 23:06:02.000000000 +0200 3 | *************** 4 | *** 50,63 **** 5 | /* If NULL, error will flush stdout, then print on stderr the program 6 | name, a colon and a space. Otherwise, error will call this 7 | function without parameters instead. */ 8 | ! extern void (*error_print_progname) (void); 9 | 10 | /* This variable is incremented each time 'error' is called. */ 11 | ! extern unsigned int error_message_count; 12 | 13 | /* Sometimes we want to have at most one error per line. This 14 | variable controls whether this mode is selected or not. */ 15 | ! extern int error_one_per_line; 16 | 17 | #ifdef __cplusplus 18 | } 19 | --- 50,63 ---- 20 | /* If NULL, error will flush stdout, then print on stderr the program 21 | name, a colon and a space. Otherwise, error will call this 22 | function without parameters instead. */ 23 | ! extern DLL_VARIABLE void (*error_print_progname) (void); 24 | 25 | /* This variable is incremented each time 'error' is called. */ 26 | ! extern DLL_VARIABLE unsigned int error_message_count; 27 | 28 | /* Sometimes we want to have at most one error per line. This 29 | variable controls whether this mode is selected or not. */ 30 | ! extern DLL_VARIABLE int error_one_per_line; 31 | 32 | #ifdef __cplusplus 33 | } 34 | -------------------------------------------------------------------------------- /gnulib-local/lib/progname.h.diff: -------------------------------------------------------------------------------- 1 | *** gnulib/lib/progname.h 2005-05-14 08:03:58.000000000 +0200 2 | --- srclib/progname.h 2005-05-20 23:06:02.000000000 +0200 3 | *************** 4 | *** 30,36 **** 5 | 6 | 7 | /* String containing name the program is called with. */ 8 | ! extern const char *program_name; 9 | 10 | /* Set program_name, based on argv[0]. */ 11 | extern void set_program_name (const char *argv0); 12 | --- 30,36 ---- 13 | 14 | 15 | /* String containing name the program is called with. */ 16 | ! extern DLL_VARIABLE const char *program_name; 17 | 18 | /* Set program_name, based on argv[0]. */ 19 | extern void set_program_name (const char *argv0); 20 | -------------------------------------------------------------------------------- /gnulib-local/lib/xstrdup.c: -------------------------------------------------------------------------------- 1 | /* xstrdup.c -- copy a string with out of memory checking 2 | Copyright (C) 1990, 1996, 2000-2003, 2005-2006 Free Software Foundation, Inc. 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . */ 16 | 17 | #include 18 | 19 | /* Specification. */ 20 | #include "xalloc.h" 21 | 22 | #include 23 | 24 | /* Return a newly allocated copy of the N bytes of memory starting at P. */ 25 | 26 | void * 27 | xmemdup (const void *p, size_t n) 28 | { 29 | void *q = xmalloc (n); 30 | memcpy (q, p, n); 31 | return q; 32 | } 33 | 34 | /* Return a newly allocated copy of STRING. */ 35 | 36 | char * 37 | xstrdup (const char *string) 38 | { 39 | return strcpy (XNMALLOC (strlen (string) + 1, char), string); 40 | } 41 | -------------------------------------------------------------------------------- /gnulib-local/m4/alloca.m4: -------------------------------------------------------------------------------- 1 | # alloca.m4 serial 5 2 | dnl Copyright (C) 2002-2003, 2006, 2011, 2021-2022 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | AC_DEFUN([gl_FUNC_ALLOCA], 8 | [ 9 | dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. 10 | AC_REQUIRE([AC_PROG_CPP]) 11 | AC_REQUIRE([AC_PROG_EGREP]) 12 | 13 | AC_REQUIRE([AC_FUNC_ALLOCA]) 14 | if test $ac_cv_func_alloca_works = no; then 15 | gl_PREREQ_ALLOCA 16 | fi 17 | 18 | # Define an additional variable used in the Makefile substitution. 19 | 20 | AC_EGREP_CPP([Need own alloca], [ 21 | #if defined __GNUC__ || defined _MSC_VER || !HAVE_ALLOCA_H 22 | Need own alloca 23 | #endif 24 | ], 25 | [GL_GENERATE_ALLOCA_H=true], 26 | [GL_GENERATE_ALLOCA_H=false]) 27 | ]) 28 | 29 | # Prerequisites of lib/alloca.c. 30 | # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. 31 | AC_DEFUN([gl_PREREQ_ALLOCA], [ 32 | AC_CHECK_HEADERS_ONCE(stdlib.h string.h) 33 | : 34 | ]) 35 | -------------------------------------------------------------------------------- /gnulib-local/modules/libiconv-misc: -------------------------------------------------------------------------------- 1 | Description: 2 | 3 | Files: 4 | 5 | Depends-on: 6 | 7 | configure.ac: 8 | 9 | Makefile.am: 10 | # Parametrization of the 'relocatable' module. 11 | AM_CPPFLAGS += -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 12 | 13 | Include: 14 | 15 | License: 16 | GPL 17 | 18 | Maintainer: 19 | Bruno Haible 20 | 21 | -------------------------------------------------------------------------------- /gnulib-local/modules/mbstate: -------------------------------------------------------------------------------- 1 | Description: 2 | mbstate_t type. 3 | 4 | Files: 5 | m4/mbstate_t.m4 6 | 7 | Depends-on: 8 | 9 | configure.ac: 10 | AC_TYPE_MBSTATE_T 11 | 12 | Makefile.am: 13 | 14 | Include: 15 | 16 | License: 17 | LGPLv2+ 18 | 19 | Maintainer: 20 | Bruno Haible 21 | 22 | -------------------------------------------------------------------------------- /gnulib-local/modules/xalloc: -------------------------------------------------------------------------------- 1 | Description: 2 | Memory allocation with out-of-memory checking. 3 | 4 | Files: 5 | lib/xalloc.h 6 | lib/xmalloc.c 7 | lib/xstrdup.c 8 | 9 | Depends-on: 10 | 11 | configure.ac: 12 | 13 | Makefile.am: 14 | lib_SOURCES += xalloc.h xmalloc.c xstrdup.c 15 | 16 | Include: 17 | "xalloc.h" 18 | 19 | License: 20 | GPL 21 | 22 | Maintainer: 23 | all 24 | -------------------------------------------------------------------------------- /include/export.h: -------------------------------------------------------------------------------- 1 | 2 | #if @HAVE_VISIBILITY@ && BUILDING_LIBICONV 3 | #define LIBICONV_DLL_EXPORTED __attribute__((__visibility__("default"))) 4 | #elif defined _MSC_VER && BUILDING_LIBICONV 5 | #define LIBICONV_DLL_EXPORTED __declspec(dllexport) 6 | #else 7 | #define LIBICONV_DLL_EXPORTED 8 | #endif 9 | -------------------------------------------------------------------------------- /lib/aliases2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2003, 2008, 2022 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | #ifdef USE_AIX 21 | # if defined _AIX 22 | # include "aliases_aix_sysaix.h" 23 | # else 24 | # include "aliases_aix.h" 25 | # endif 26 | #endif 27 | #ifdef USE_OSF1 28 | # if defined __osf__ 29 | # include "aliases_osf1_sysosf1.h" 30 | # else 31 | # include "aliases_osf1.h" 32 | # endif 33 | #endif 34 | #ifdef USE_DOS 35 | # include "aliases_dos.h" 36 | #endif 37 | #ifdef USE_ZOS 38 | # include "aliases_zos.h" 39 | #endif 40 | #ifdef USE_EXTRA 41 | # include "aliases_extra.h" 42 | #endif 43 | -------------------------------------------------------------------------------- /lib/ascii.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * ASCII 22 | */ 23 | 24 | static int 25 | ascii_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | if (c < 0x80) { 29 | *pwc = (ucs4_t) c; 30 | return 1; 31 | } 32 | return RET_ILSEQ; 33 | } 34 | 35 | static int 36 | ascii_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 37 | { 38 | if (wc < 0x0080) { 39 | *r = wc; 40 | return 1; 41 | } 42 | return RET_ILUNI; 43 | } 44 | -------------------------------------------------------------------------------- /lib/ces_big5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * BIG-5 22 | */ 23 | 24 | static int 25 | ces_big5_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | /* Code set 0 (ASCII) */ 29 | if (c < 0x80) 30 | return ascii_mbtowc(conv,pwc,s,n); 31 | /* Code set 1 (BIG5) */ 32 | if (c >= 0xa1 && c < 0xff) { 33 | if (n < 2) 34 | return RET_TOOFEW(0); 35 | { 36 | unsigned char c2 = s[1]; 37 | if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0xa1 && c2 < 0xff)) 38 | return big5_mbtowc(conv,pwc,s,2); 39 | else 40 | return RET_ILSEQ; 41 | } 42 | } 43 | return RET_ILSEQ; 44 | } 45 | 46 | static int 47 | ces_big5_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 48 | { 49 | unsigned char buf[2]; 50 | int ret; 51 | 52 | /* Code set 0 (ASCII) */ 53 | ret = ascii_wctomb(conv,r,wc,n); 54 | if (ret != RET_ILUNI) 55 | return ret; 56 | 57 | /* Code set 1 (BIG5) */ 58 | ret = big5_wctomb(conv,buf,wc,2); 59 | if (ret != RET_ILUNI) { 60 | if (ret != 2) abort(); 61 | if (n < 2) 62 | return RET_TOOSMALL; 63 | r[0] = buf[0]; 64 | r[1] = buf[1]; 65 | return 2; 66 | } 67 | 68 | return RET_ILUNI; 69 | } 70 | -------------------------------------------------------------------------------- /lib/ces_gbk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2005, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * GBK 22 | */ 23 | 24 | static int 25 | ces_gbk_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | 29 | /* Code set 0 (ASCII or GB 1988-89) */ 30 | if (c < 0x80) 31 | return ascii_mbtowc(conv,pwc,s,n); 32 | /* Code set 1 (GBK) */ 33 | if (c >= 0x81 && c < 0xff) { 34 | if (n < 2) 35 | return RET_TOOFEW(0); 36 | return gbk_mbtowc(conv,pwc,s,2); 37 | } 38 | return RET_ILSEQ; 39 | } 40 | 41 | static int 42 | ces_gbk_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 43 | { 44 | unsigned char buf[2]; 45 | int ret; 46 | 47 | /* Code set 0 (ASCII or GB 1988-89) */ 48 | ret = ascii_wctomb(conv,r,wc,n); 49 | if (ret != RET_ILUNI) 50 | return ret; 51 | 52 | /* Code set 1 (GBK) */ 53 | ret = gbk_wctomb(conv,buf,wc,2); 54 | if (ret != RET_ILUNI) { 55 | if (ret != 2) abort(); 56 | if (n < 2) 57 | return RET_TOOSMALL; 58 | r[0] = buf[0]; 59 | r[1] = buf[1]; 60 | return 2; 61 | } 62 | 63 | return RET_ILUNI; 64 | } 65 | -------------------------------------------------------------------------------- /lib/cns11643.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * CNS 11643-1992 22 | */ 23 | 24 | /* ISO-2022-CN and EUC-TW use CNS 11643-1992 planes 1 to 7. We also 25 | * have a table for the older plane 15. We use a trick to keep the 26 | * Unicode -> CNS 11643 table as small as possible (see cns11643_inv.h). 27 | */ 28 | 29 | #include "cns11643_1.h" 30 | #include "cns11643_2.h" 31 | #include "cns11643_3.h" 32 | #include "cns11643_4.h" 33 | #include "cns11643_5.h" 34 | #include "cns11643_6.h" 35 | #include "cns11643_7.h" 36 | #include "cns11643_15.h" 37 | #include "cns11643_inv.h" 38 | 39 | /* Returns the plane number (1,...,7,15) in r[0], the two bytes in r[1],r[2]. */ 40 | #define cns11643_wctomb cns11643_inv_wctomb 41 | -------------------------------------------------------------------------------- /lib/cns11643_4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * CNS 11643-1992 plane 4 22 | */ 23 | 24 | /* 25 | * The table has been split into two parts. Each part's entries fit it 16 bits. 26 | * But the combined table would need 17 bits per entry. 27 | */ 28 | #include "cns11643_4a.h" 29 | #include "cns11643_4b.h" 30 | 31 | static int 32 | cns11643_4_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 33 | { 34 | unsigned char c1 = s[0]; 35 | if ((c1 >= 0x21 && c1 <= 0x6e)) { 36 | if (n >= 2) { 37 | unsigned char c2 = s[1]; 38 | if (c2 >= 0x21 && c2 < 0x7f) { 39 | unsigned int i = 94 * (c1 - 0x21) + (c2 - 0x21); 40 | ucs4_t wc = 0xfffd; 41 | unsigned short swc; 42 | { 43 | if (i < 2914) 44 | swc = cns11643_4a_2uni_page21[i], 45 | wc = cns11643_4a_2uni_upages[swc>>8] | (swc & 0xff); 46 | else if (i < 7298) 47 | swc = cns11643_4b_2uni_page40[i-2914], 48 | wc = cns11643_4b_2uni_upages[swc>>8] | (swc & 0xff); 49 | } 50 | if (wc != 0xfffd) { 51 | *pwc = wc; 52 | return 2; 53 | } 54 | } 55 | return RET_ILSEQ; 56 | } 57 | return RET_TOOFEW(0); 58 | } 59 | return RET_ILSEQ; 60 | } 61 | -------------------------------------------------------------------------------- /lib/config.h.in: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1999-2003, 2005, 2007, 2010, 2012 Free Software Foundation, Inc. 2 | This file is part of the GNU LIBICONV Library. 3 | 4 | The GNU LIBICONV Library is free software; you can redistribute it 5 | and/or modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either version 2.1 7 | of the License, or (at your option) any later version. 8 | 9 | The GNU LIBICONV Library is distributed in the hope that it will be 10 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with the GNU LIBICONV Library; see the file COPYING.LIB. 16 | If not, see . */ 17 | 18 | 19 | /* Define to 1 to enable a few rarely used encodings. */ 20 | #undef ENABLE_EXTRA 21 | 22 | /* Define to 1 if the package shall run at any location in the filesystem. */ 23 | #undef ENABLE_RELOCATABLE 24 | 25 | /* Define to a type if does not define. */ 26 | #undef mbstate_t 27 | 28 | /* Define if you have , the iconv_t type, and the 29 | iconv_open, iconv, iconv_close functions. */ 30 | #undef HAVE_ICONV 31 | /* Define as const if the declaration of iconv() needs const. */ 32 | #define ICONV_CONST /* empty by default */ 33 | 34 | /* Define to 1 if you have the getc_unlocked() function. */ 35 | #undef HAVE_GETC_UNLOCKED 36 | 37 | /* Define if you have and nl_langinfo(CODESET). */ 38 | #undef HAVE_LANGINFO_CODESET 39 | 40 | /* Define if you have the mbrtowc() function. */ 41 | #undef HAVE_MBRTOWC 42 | 43 | /* Define to 1 if you have the setlocale() function. */ 44 | #undef HAVE_SETLOCALE 45 | 46 | /* Define to 1 if you have the header file. */ 47 | #undef HAVE_STDDEF_H 48 | 49 | /* Define to 1 if you have the header file. */ 50 | #undef HAVE_STDLIB_H 51 | 52 | /* Define to 1 if you have the header file. */ 53 | #undef HAVE_STRING_H 54 | 55 | /* Define to 1 or 0, depending whether the compiler supports simple visibility 56 | declarations. */ 57 | #undef HAVE_VISIBILITY 58 | 59 | /* Define if you have the wcrtomb() function. */ 60 | #undef HAVE_WCRTOMB 61 | 62 | /* Define to 1 if O_NOFOLLOW works. */ 63 | #undef HAVE_WORKING_O_NOFOLLOW 64 | 65 | /* Define if the machine's byte ordering is little endian. */ 66 | #undef WORDS_LITTLEENDIAN 67 | 68 | /* Define to the value of ${prefix}, as a string. */ 69 | #undef INSTALLPREFIX 70 | 71 | /* Define to '__inline__' or '__inline' if that's what the C compiler 72 | calls it, or to nothing if 'inline' is not supported under any name. */ 73 | #ifndef __cplusplus 74 | #undef inline 75 | #endif 76 | 77 | /* Define to 'int' if does not define. */ 78 | #undef mode_t 79 | 80 | /* Define as a signed type of the same size as size_t. */ 81 | #undef ssize_t 82 | 83 | -------------------------------------------------------------------------------- /lib/cp1162.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2002, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * CP1162 22 | */ 23 | 24 | static int 25 | cp1162_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | if (c < 0x80) { 29 | *pwc = (ucs4_t) c; 30 | return 1; 31 | } 32 | else { 33 | unsigned short wc = cp874_2uni[c-0x80]; 34 | if (wc != 0xfffd) { 35 | *pwc = (ucs4_t) wc; 36 | return 1; 37 | } 38 | if (c < 0xa0) { 39 | *pwc = (ucs4_t) c; 40 | return 1; 41 | } 42 | } 43 | return RET_ILSEQ; 44 | } 45 | 46 | static int 47 | cp1162_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 48 | { 49 | unsigned char c = 0; 50 | if (wc < 0x0080) { 51 | *r = wc; 52 | return 1; 53 | } 54 | else if (wc >= 0x0080 && wc < 0x00a0 && cp874_2uni[wc-0x0080] == 0xfffd) 55 | c = wc; 56 | else if (wc == 0x00a0) 57 | c = 0xa0; 58 | else if (wc >= 0x0e00 && wc < 0x0e60) 59 | c = cp874_page0e[wc-0x0e00]; 60 | else if (wc >= 0x2010 && wc < 0x2028) 61 | c = cp874_page20[wc-0x2010]; 62 | else if (wc == 0x20ac) 63 | c = 0x80; 64 | if (c != 0) { 65 | *r = c; 66 | return 1; 67 | } 68 | return RET_ILUNI; 69 | } 70 | -------------------------------------------------------------------------------- /lib/cp1163.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2002, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * CP1163 22 | */ 23 | 24 | static int 25 | cp1163_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | if (c < 0xa0) 29 | *pwc = (ucs4_t) c; 30 | else if (c == 0xa4) 31 | *pwc = 0x20ac; 32 | else 33 | *pwc = (ucs4_t) cp1129_2uni[c-0xa0]; 34 | return 1; 35 | } 36 | 37 | static const unsigned char cp1163_page20[8] = { 38 | 0x00, 0x00, 0x00, 0xfe, 0xa4, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 39 | }; 40 | 41 | static int 42 | cp1163_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 43 | { 44 | unsigned char c = 0; 45 | if (wc < 0x00a0 || (wc < 0x00a8 && wc != 0x00a4) || wc == 0x00d0) { 46 | *r = wc; 47 | return 1; 48 | } 49 | else if (wc >= 0x00a8 && wc < 0x01b8) 50 | c = cp1129_page00[wc-0x00a8]; 51 | else if (wc >= 0x0300 && wc < 0x0328) 52 | c = cp1129_page03[wc-0x0300]; 53 | else if (wc == 0x203e) 54 | c = 0xaf; 55 | else if (wc >= 0x20a8 && wc < 0x20b0) 56 | c = cp1163_page20[wc-0x20a8]; 57 | if (c != 0) { 58 | *r = c; 59 | return 1; 60 | } 61 | return RET_ILUNI; 62 | } 63 | -------------------------------------------------------------------------------- /lib/cp858.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2002, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * CP858 22 | */ 23 | 24 | static int 25 | cp858_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | if (c < 0x80) 29 | *pwc = (ucs4_t) c; 30 | else if (c == 0xd5) 31 | *pwc = 0x20ac; 32 | else 33 | *pwc = (ucs4_t) cp850_2uni[c-0x80]; 34 | return 1; 35 | } 36 | 37 | static int 38 | cp858_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 39 | { 40 | unsigned char c = 0; 41 | if (wc < 0x0080) { 42 | *r = wc; 43 | return 1; 44 | } 45 | else if (wc >= 0x00a0 && wc < 0x0100) 46 | c = cp850_page00[wc-0x00a0]; 47 | else if (wc == 0x0192) 48 | c = 0x9f; 49 | else if (wc == 0x2017) 50 | c = 0xf2; 51 | else if (wc == 0x20ac) 52 | c = 0xd5; 53 | else if (wc >= 0x2500 && wc < 0x25a8) 54 | c = cp850_page25[wc-0x2500]; 55 | if (c != 0) { 56 | *r = c; 57 | return 1; 58 | } 59 | return RET_ILUNI; 60 | } 61 | -------------------------------------------------------------------------------- /lib/cp943.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * IBM CP943 22 | */ 23 | 24 | /* This is essentially CP932, with many mappings missing in the AIX conversion 25 | table. We just pretend it were the same as CP932. */ 26 | 27 | #define cp943_mbtowc cp932_mbtowc 28 | #define cp943_wctomb cp932_wctomb 29 | -------------------------------------------------------------------------------- /lib/dec_kanji.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * DEC-KANJI 22 | */ 23 | 24 | static int 25 | dec_kanji_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | /* Code set 0 (ASCII or JIS X 0201-1976 Roman) */ 29 | if (c < 0x80) 30 | return ascii_mbtowc(conv,pwc,s,n); 31 | /* Code set 1 (JIS X 0208) */ 32 | if (c >= 0xa1 && c < 0xf5) { 33 | if (n < 2) 34 | return RET_TOOFEW(0); 35 | { 36 | unsigned char c2 = s[1]; 37 | if (c2 >= 0xa1 && c2 < 0xff) { 38 | unsigned char buf[2]; 39 | buf[0] = c-0x80; buf[1] = c2-0x80; 40 | return jisx0208_mbtowc(conv,pwc,buf,2); 41 | } 42 | } 43 | } 44 | return RET_ILSEQ; 45 | } 46 | 47 | static int 48 | dec_kanji_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 49 | { 50 | unsigned char buf[2]; 51 | int ret; 52 | 53 | /* Code set 0 (ASCII or JIS X 0201-1976 Roman) */ 54 | ret = ascii_wctomb(conv,r,wc,n); 55 | if (ret != RET_ILUNI) 56 | return ret; 57 | 58 | /* Code set 1 (JIS X 0208) */ 59 | ret = jisx0208_wctomb(conv,buf,wc,2); 60 | if (ret != RET_ILUNI) { 61 | if (ret != 2) abort(); 62 | if (n < 2) 63 | return RET_TOOSMALL; 64 | r[0] = buf[0]+0x80; 65 | r[1] = buf[1]+0x80; 66 | return 2; 67 | } 68 | 69 | return RET_ILUNI; 70 | } 71 | -------------------------------------------------------------------------------- /lib/encodings_extra.def: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2002, 2005, 2008 Free Software Foundation, Inc. 2 | This file is part of the GNU LIBICONV Library. 3 | 4 | The GNU LIBICONV Library is free software; you can redistribute it 5 | and/or modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either version 2.1 7 | of the License, or (at your option) any later version. 8 | 9 | The GNU LIBICONV Library is distributed in the hope that it will be 10 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with the GNU LIBICONV Library; see the file COPYING.LIB. 16 | If not, see . */ 17 | 18 | DEFENCODING(( "EUC-JISX0213", 19 | "EUC-JIS-2004", /* x0213.org */ 20 | ), 21 | euc_jisx0213, 22 | { euc_jisx0213_mbtowc, euc_jisx0213_flushwc }, { euc_jisx0213_wctomb, euc_jisx0213_reset }) 23 | 24 | DEFENCODING(( "SHIFT_JISX0213", 25 | "SHIFT_JIS-2004", /* x0213.org */ 26 | ), 27 | shift_jisx0213, 28 | { shift_jisx0213_mbtowc, shift_jisx0213_flushwc }, { shift_jisx0213_wctomb, shift_jisx0213_reset }) 29 | 30 | DEFENCODING(( "ISO-2022-JP-3", 31 | "ISO-2022-JP-2004", /* x0213.org */ 32 | ), 33 | iso2022_jp3, 34 | { iso2022_jp3_mbtowc, iso2022_jp3_flushwc }, { iso2022_jp3_wctomb, iso2022_jp3_reset }) 35 | 36 | DEFENCODING(( "BIG5-2003", 37 | ), 38 | big5_2003, 39 | { big5_2003_mbtowc, NULL }, { big5_2003_wctomb, NULL }) 40 | 41 | DEFENCODING(( "TDS565", 42 | "ISO-IR-230", 43 | ), 44 | tds565, 45 | { tds565_mbtowc, NULL }, { tds565_wctomb, NULL }) 46 | 47 | DEFENCODING(( "ATARIST", 48 | "ATARI", 49 | ), 50 | atarist, 51 | { atarist_mbtowc, NULL }, { atarist_wctomb, NULL }) 52 | 53 | DEFENCODING(( "RISCOS-LATIN1", 54 | ), 55 | riscos1, 56 | { riscos1_mbtowc, NULL }, { riscos1_wctomb, NULL }) 57 | -------------------------------------------------------------------------------- /lib/encodings_local.def: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2000-2001 Free Software Foundation, Inc. 2 | This file is part of the GNU LIBICONV Library. 3 | 4 | The GNU LIBICONV Library is free software; you can redistribute it 5 | and/or modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either version 2.1 7 | of the License, or (at your option) any later version. 8 | 9 | The GNU LIBICONV Library is distributed in the hope that it will be 10 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with the GNU LIBICONV Library; see the file COPYING.LIB. 16 | If not, see . */ 17 | 18 | /* Names for locale dependent encodings. */ 19 | 20 | DEFENCODING(( "CHAR", 21 | ), 22 | local_char, 23 | { NULL, NULL }, { NULL, NULL }) 24 | 25 | DEFENCODING(( "WCHAR_T", /* glibc */ 26 | ), 27 | local_wchar_t, 28 | { NULL, NULL }, { NULL, NULL }) 29 | -------------------------------------------------------------------------------- /lib/encodings_osf1.def: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2001, 2008 Free Software Foundation, Inc. 2 | This file is part of the GNU LIBICONV Library. 3 | 4 | The GNU LIBICONV Library is free software; you can redistribute it 5 | and/or modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either version 2.1 7 | of the License, or (at your option) any later version. 8 | 9 | The GNU LIBICONV Library is distributed in the hope that it will be 10 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with the GNU LIBICONV Library; see the file COPYING.LIB. 16 | If not, see . */ 17 | 18 | /* Encodings used by system dependent locales on OSF/1 a.k.a. Tru64. */ 19 | 20 | DEFENCODING(( "DEC-KANJI", 21 | ), 22 | dec_kanji, 23 | { dec_kanji_mbtowc, NULL }, { dec_kanji_wctomb, NULL }) 24 | #ifdef USE_OSF1_ALIASES 25 | DEFALIAS( "DECKANJI", /* OSF/1 */ 26 | dec_kanji) 27 | #endif 28 | 29 | DEFENCODING(( "DEC-HANYU", 30 | ), 31 | dec_hanyu, 32 | { dec_hanyu_mbtowc, NULL }, { dec_hanyu_wctomb, NULL }) 33 | #ifdef USE_OSF1_ALIASES 34 | DEFALIAS( "DECHANYU", /* OSF/1 */ 35 | dec_hanyu) 36 | #endif 37 | -------------------------------------------------------------------------------- /lib/euc_cn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * EUC-CN 22 | */ 23 | 24 | static int 25 | euc_cn_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | /* Code set 0 (ASCII or GB 1988-89) */ 29 | if (c < 0x80) 30 | return ascii_mbtowc(conv,pwc,s,n); 31 | /* Code set 1 (GB 2312-1980) */ 32 | if (c >= 0xa1 && c < 0xff) { 33 | if (n < 2) 34 | return RET_TOOFEW(0); 35 | { 36 | unsigned char c2 = s[1]; 37 | if (c2 >= 0xa1 && c2 < 0xff) { 38 | unsigned char buf[2]; 39 | buf[0] = c-0x80; buf[1] = c2-0x80; 40 | return gb2312_mbtowc(conv,pwc,buf,2); 41 | } else 42 | return RET_ILSEQ; 43 | } 44 | } 45 | return RET_ILSEQ; 46 | } 47 | 48 | static int 49 | euc_cn_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 50 | { 51 | unsigned char buf[2]; 52 | int ret; 53 | 54 | /* Code set 0 (ASCII or GB 1988-89) */ 55 | ret = ascii_wctomb(conv,r,wc,n); 56 | if (ret != RET_ILUNI) 57 | return ret; 58 | 59 | /* Code set 1 (GB 2312-1980) */ 60 | ret = gb2312_wctomb(conv,buf,wc,2); 61 | if (ret != RET_ILUNI) { 62 | if (ret != 2) abort(); 63 | if (n < 2) 64 | return RET_TOOSMALL; 65 | r[0] = buf[0]+0x80; 66 | r[1] = buf[1]+0x80; 67 | return 2; 68 | } 69 | 70 | return RET_ILUNI; 71 | } 72 | -------------------------------------------------------------------------------- /lib/euc_kr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2007, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * EUC-KR 22 | */ 23 | 24 | /* Specification: RFC 1557 */ 25 | 26 | static int 27 | euc_kr_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 28 | { 29 | unsigned char c = *s; 30 | /* Code set 0 (ASCII or KS C 5636-1993) */ 31 | if (c < 0x80) 32 | return ascii_mbtowc(conv,pwc,s,n); 33 | /* Code set 1 (KS C 5601-1992, now KS X 1001:2002) */ 34 | if (c >= 0xa1 && c < 0xff) { 35 | if (n < 2) 36 | return RET_TOOFEW(0); 37 | { 38 | unsigned char c2 = s[1]; 39 | if (c2 >= 0xa1 && c2 < 0xff) { 40 | unsigned char buf[2]; 41 | buf[0] = c-0x80; buf[1] = c2-0x80; 42 | return ksc5601_mbtowc(conv,pwc,buf,2); 43 | } else 44 | return RET_ILSEQ; 45 | } 46 | } 47 | return RET_ILSEQ; 48 | } 49 | 50 | static int 51 | euc_kr_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 52 | { 53 | unsigned char buf[2]; 54 | int ret; 55 | 56 | /* Code set 0 (ASCII or KS C 5636-1993) */ 57 | ret = ascii_wctomb(conv,r,wc,n); 58 | if (ret != RET_ILUNI) 59 | return ret; 60 | 61 | /* Code set 1 (KS C 5601-1992, now KS X 1001:2002) */ 62 | ret = ksc5601_wctomb(conv,buf,wc,2); 63 | if (ret != RET_ILUNI) { 64 | if (ret != 2) abort(); 65 | if (n < 2) 66 | return RET_TOOSMALL; 67 | r[0] = buf[0]+0x80; 68 | r[1] = buf[1]+0x80; 69 | return 2; 70 | } 71 | 72 | return RET_ILUNI; 73 | } 74 | -------------------------------------------------------------------------------- /lib/flushwc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | #ifndef _FLUSHWC_H 21 | #define _FLUSHWC_H 22 | 23 | static int 24 | normal_flushwc (conv_t conv, ucs4_t *pwc) 25 | { 26 | ucs4_t last_wc = conv->istate; 27 | if (last_wc) { 28 | /* Output the buffered character. */ 29 | conv->istate = 0; 30 | *pwc = (ucs4_t) last_wc; 31 | return 1; 32 | } else 33 | return 0; 34 | } 35 | 36 | #endif /* _FLUSHWC_H */ 37 | -------------------------------------------------------------------------------- /lib/gb12345.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * GB/T 12345-1990 22 | */ 23 | 24 | /* 25 | * GB/T 12345-1990 is a traditional chinese counterpart of GB 2312-1986. 26 | * According to the unicode.org tables: 27 | * 2146 characters have been changed to their traditional counterpart, 28 | * 103 characters have been added, no characters have been removed. 29 | * Therefore we use an auxiliary table, which contains only the changes. 30 | */ 31 | 32 | #include "gb12345ext.h" 33 | 34 | static int 35 | gb12345_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 36 | { 37 | int ret; 38 | 39 | /* The gb12345ext table overrides some entries in the gb2312 table. */ 40 | /* Try the GB12345 extensions -> Unicode table. */ 41 | ret = gb12345ext_mbtowc(conv,pwc,s,n); 42 | if (ret != RET_ILSEQ) 43 | return ret; 44 | /* Try the GB2312 -> Unicode table. */ 45 | ret = gb2312_mbtowc(conv,pwc,s,n); 46 | return ret; 47 | } 48 | 49 | static int 50 | gb12345_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 51 | { 52 | int ret; 53 | 54 | /* The gb12345ext table overrides some entries in the gb2312 table. */ 55 | /* Try the Unicode -> GB12345 extensions table. */ 56 | ret = gb12345ext_wctomb(conv,r,wc,n); 57 | if (ret != RET_ILUNI) 58 | return ret; 59 | /* Try the Unicode -> GB2312 table, and check that the resulting GB2312 60 | byte sequence is not overridden by the GB12345 extensions table. */ 61 | ret = gb2312_wctomb(conv,r,wc,n); 62 | if (ret == 2 && gb12345ext_mbtowc(conv,&wc,r,2) == 2) 63 | return RET_ILUNI; 64 | else 65 | return ret; 66 | } 67 | -------------------------------------------------------------------------------- /lib/iso646_cn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * ISO646-CN 22 | * also known as GB_1988-80 23 | */ 24 | 25 | static int 26 | iso646_cn_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 27 | { 28 | unsigned char c = *s; 29 | if (c < 0x80) { 30 | if (c == 0x24) 31 | *pwc = (ucs4_t) 0x00a5; 32 | else if (c == 0x7e) 33 | *pwc = (ucs4_t) 0x203e; 34 | else 35 | *pwc = (ucs4_t) c; 36 | return 1; 37 | } 38 | return RET_ILSEQ; 39 | } 40 | 41 | static int 42 | iso646_cn_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 43 | { 44 | if (wc < 0x0080 && !(wc == 0x0024 || wc == 0x007e)) { 45 | *r = wc; 46 | return 1; 47 | } 48 | if (wc == 0x00a5) { 49 | *r = 0x24; 50 | return 1; 51 | } 52 | if (wc == 0x203e) { 53 | *r = 0x7e; 54 | return 1; 55 | } 56 | return RET_ILUNI; 57 | } 58 | -------------------------------------------------------------------------------- /lib/iso646_jp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * ISO646-JP 22 | * also known as JIS_C6220-1969-RO 23 | */ 24 | 25 | /* This is the lower half of JIS_X0201. */ 26 | 27 | static int 28 | iso646_jp_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 29 | { 30 | unsigned char c = *s; 31 | if (c < 0x80) { 32 | if (c == 0x5c) 33 | *pwc = (ucs4_t) 0x00a5; 34 | else if (c == 0x7e) 35 | *pwc = (ucs4_t) 0x203e; 36 | else 37 | *pwc = (ucs4_t) c; 38 | return 1; 39 | } 40 | return RET_ILSEQ; 41 | } 42 | 43 | static int 44 | iso646_jp_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 45 | { 46 | if (wc < 0x0080 && !(wc == 0x005c || wc == 0x007e)) { 47 | *r = wc; 48 | return 1; 49 | } 50 | if (wc == 0x00a5) { 51 | *r = 0x5c; 52 | return 1; 53 | } 54 | if (wc == 0x203e) { 55 | *r = 0x7e; 56 | return 1; 57 | } 58 | return RET_ILUNI; 59 | } 60 | -------------------------------------------------------------------------------- /lib/iso8859_1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * ISO-8859-1 22 | */ 23 | 24 | static int 25 | iso8859_1_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | *pwc = (ucs4_t) c; 29 | return 1; 30 | } 31 | 32 | static int 33 | iso8859_1_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 34 | { 35 | if (wc < 0x0100) { 36 | *r = wc; 37 | return 1; 38 | } 39 | return RET_ILUNI; 40 | } 41 | -------------------------------------------------------------------------------- /lib/iso8859_11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2004, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * ISO-8859-11 22 | */ 23 | 24 | static int 25 | iso8859_11_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | if (c < 0xa1) { 29 | *pwc = (ucs4_t) c; 30 | return 1; 31 | } 32 | else if (c <= 0xfb && !(c >= 0xdb && c <= 0xde)) { 33 | *pwc = (ucs4_t) (c + 0x0d60); 34 | return 1; 35 | } 36 | return RET_ILSEQ; 37 | } 38 | 39 | static int 40 | iso8859_11_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 41 | { 42 | if (wc < 0x00a1) { 43 | *r = wc; 44 | return 1; 45 | } 46 | else if (wc >= 0x0e01 && wc <= 0x0e5b && !(wc >= 0x0e3b && wc <= 0x0e3e)) { 47 | *r = wc-0x0d60; 48 | return 1; 49 | } 50 | return RET_ILUNI; 51 | } 52 | -------------------------------------------------------------------------------- /lib/iso8859_15.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * ISO-8859-15 22 | */ 23 | 24 | static const unsigned short iso8859_15_2uni[32] = { 25 | /* 0xa0 */ 26 | 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7, 27 | 0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 28 | /* 0xb0 */ 29 | 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7, 30 | 0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf, 31 | }; 32 | 33 | static int 34 | iso8859_15_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 35 | { 36 | unsigned char c = *s; 37 | if (c >= 0xa0 && c < 0xc0) 38 | *pwc = (ucs4_t) iso8859_15_2uni[c-0xa0]; 39 | else 40 | *pwc = (ucs4_t) c; 41 | return 1; 42 | } 43 | 44 | static const unsigned char iso8859_15_page00[32] = { 45 | 0xa0, 0xa1, 0xa2, 0xa3, 0x00, 0xa5, 0x00, 0xa7, /* 0xa0-0xa7 */ 46 | 0x00, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 47 | 0xb0, 0xb1, 0xb2, 0xb3, 0x00, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 48 | 0x00, 0xb9, 0xba, 0xbb, 0x00, 0x00, 0x00, 0xbf, /* 0xb8-0xbf */ 49 | }; 50 | static const unsigned char iso8859_15_page01[48] = { 51 | 0x00, 0x00, 0xbc, 0xbd, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 53 | 0xa6, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 56 | 0xbe, 0x00, 0x00, 0x00, 0x00, 0xb4, 0xb8, 0x00, /* 0x78-0x7f */ 57 | }; 58 | 59 | static int 60 | iso8859_15_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 61 | { 62 | unsigned char c = 0; 63 | if (wc < 0x00a0) { 64 | *r = wc; 65 | return 1; 66 | } 67 | else if (wc >= 0x00a0 && wc < 0x00c0) 68 | c = iso8859_15_page00[wc-0x00a0]; 69 | else if (wc >= 0x00c0 && wc < 0x0100) 70 | c = wc; 71 | else if (wc >= 0x0150 && wc < 0x0180) 72 | c = iso8859_15_page01[wc-0x0150]; 73 | else if (wc == 0x20ac) 74 | c = 0xa4; 75 | if (c != 0) { 76 | *r = c; 77 | return 1; 78 | } 79 | return RET_ILUNI; 80 | } 81 | -------------------------------------------------------------------------------- /lib/jisx0201.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * JISX0201.1976-0 22 | */ 23 | 24 | static int 25 | jisx0201_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | if (c < 0x80) { 29 | if (c == 0x5c) 30 | *pwc = (ucs4_t) 0x00a5; 31 | else if (c == 0x7e) 32 | *pwc = (ucs4_t) 0x203e; 33 | else 34 | *pwc = (ucs4_t) c; 35 | return 1; 36 | } else { 37 | if (c >= 0xa1 && c < 0xe0) { 38 | *pwc = (ucs4_t) c + 0xfec0; 39 | return 1; 40 | } 41 | } 42 | return RET_ILSEQ; 43 | } 44 | 45 | static int 46 | jisx0201_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 47 | { 48 | if (wc < 0x0080 && !(wc == 0x005c || wc == 0x007e)) { 49 | *r = wc; 50 | return 1; 51 | } 52 | if (wc == 0x00a5) { 53 | *r = 0x5c; 54 | return 1; 55 | } 56 | if (wc == 0x203e) { 57 | *r = 0x7e; 58 | return 1; 59 | } 60 | if (wc >= 0xff61 && wc < 0xffa0) { 61 | *r = wc - 0xfec0; 62 | return 1; 63 | } 64 | return RET_ILUNI; 65 | } 66 | -------------------------------------------------------------------------------- /lib/loops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* This file defines all the loops. */ 21 | 22 | #include "loop_unicode.h" 23 | #include "loop_wchar.h" 24 | 25 | -------------------------------------------------------------------------------- /lib/tis620.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * TIS620.2533-1 22 | */ 23 | 24 | static int 25 | tis620_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | unsigned char c = *s; 28 | if (c < 0x80) { 29 | *pwc = (ucs4_t) c; 30 | return 1; 31 | } 32 | else if (c >= 0xa1 && c <= 0xfb && !(c >= 0xdb && c <= 0xde)) { 33 | *pwc = (ucs4_t) (c + 0x0d60); 34 | return 1; 35 | } 36 | return RET_ILSEQ; 37 | } 38 | 39 | static int 40 | tis620_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 41 | { 42 | if (wc < 0x0080) { 43 | *r = wc; 44 | return 1; 45 | } 46 | else if (wc >= 0x0e01 && wc <= 0x0e5b && !(wc >= 0x0e3b && wc <= 0x0e3e)) { 47 | *r = wc-0x0d60; 48 | return 1; 49 | } 50 | return RET_ILUNI; 51 | } 52 | -------------------------------------------------------------------------------- /lib/ucs2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2008, 2011, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UCS-2 22 | */ 23 | 24 | /* Here we accept FFFE/FEFF marks as endianness indicators everywhere 25 | in the stream, not just at the beginning. The default is big-endian. */ 26 | /* The state is 0 if big-endian, 1 if little-endian. */ 27 | static int 28 | ucs2_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 29 | { 30 | state_t state = conv->istate; 31 | int count = 0; 32 | for (; n >= 2 && count <= RET_COUNT_MAX && count <= INT_MAX-2;) { 33 | ucs4_t wc = (state ? s[0] + (s[1] << 8) : (s[0] << 8) + s[1]); 34 | if (wc == 0xfeff) { 35 | } else if (wc == 0xfffe) { 36 | state ^= 1; 37 | } else if (wc >= 0xd800 && wc < 0xe000) { 38 | conv->istate = state; 39 | return RET_SHIFT_ILSEQ(count); 40 | } else { 41 | *pwc = wc; 42 | conv->istate = state; 43 | return count+2; 44 | } 45 | s += 2; n -= 2; count += 2; 46 | } 47 | conv->istate = state; 48 | return RET_TOOFEW(count); 49 | } 50 | 51 | /* But we output UCS-2 in big-endian order, without byte-order mark. */ 52 | /* RFC 2152 says: 53 | "ISO/IEC 10646-1:1993(E) specifies that when characters the UCS-2 form are 54 | serialized as octets, that the most significant octet appear first." */ 55 | static int 56 | ucs2_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 57 | { 58 | if (wc < 0x10000 && wc != 0xfffe && !(wc >= 0xd800 && wc < 0xe000)) { 59 | if (n >= 2) { 60 | r[0] = (unsigned char) (wc >> 8); 61 | r[1] = (unsigned char) wc; 62 | return 2; 63 | } else 64 | return RET_TOOSMALL; 65 | } else 66 | return RET_ILUNI; 67 | } 68 | -------------------------------------------------------------------------------- /lib/ucs2be.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UCS-2BE = UCS-2 big endian 22 | */ 23 | 24 | static int 25 | ucs2be_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | if (n >= 2) { 28 | if (s[0] >= 0xd8 && s[0] < 0xe0) { 29 | return RET_ILSEQ; 30 | } else { 31 | *pwc = (s[0] << 8) + s[1]; 32 | return 2; 33 | } 34 | } 35 | return RET_TOOFEW(0); 36 | } 37 | 38 | static int 39 | ucs2be_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 40 | { 41 | if (wc < 0x10000 && !(wc >= 0xd800 && wc < 0xe000)) { 42 | if (n >= 2) { 43 | r[0] = (unsigned char) (wc >> 8); 44 | r[1] = (unsigned char) wc; 45 | return 2; 46 | } else 47 | return RET_TOOSMALL; 48 | } 49 | return RET_ILUNI; 50 | } 51 | -------------------------------------------------------------------------------- /lib/ucs2internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UCS-2-INTERNAL = UCS-2 with machine dependent endianness and alignment 22 | */ 23 | 24 | static int 25 | ucs2internal_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | if (n >= 2) { 28 | unsigned short x = *(const unsigned short *)s; 29 | if (x >= 0xd800 && x < 0xe000) { 30 | return RET_ILSEQ; 31 | } else { 32 | *pwc = x; 33 | return 2; 34 | } 35 | } 36 | return RET_TOOFEW(0); 37 | } 38 | 39 | static int 40 | ucs2internal_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 41 | { 42 | if (wc < 0x10000 && !(wc >= 0xd800 && wc < 0xe000)) { 43 | if (n >= 2) { 44 | *(unsigned short *)r = wc; 45 | return 2; 46 | } else 47 | return RET_TOOSMALL; 48 | } else 49 | return RET_ILUNI; 50 | } 51 | -------------------------------------------------------------------------------- /lib/ucs2le.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UCS-2LE = UCS-2 little endian 22 | */ 23 | 24 | static int 25 | ucs2le_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | if (n >= 2) { 28 | if (s[1] >= 0xd8 && s[1] < 0xe0) { 29 | return RET_ILSEQ; 30 | } else { 31 | *pwc = s[0] + (s[1] << 8); 32 | return 2; 33 | } 34 | } 35 | return RET_TOOFEW(0); 36 | } 37 | 38 | static int 39 | ucs2le_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 40 | { 41 | if (wc < 0x10000 && !(wc >= 0xd800 && wc < 0xe000)) { 42 | if (n >= 2) { 43 | r[0] = (unsigned char) wc; 44 | r[1] = (unsigned char) (wc >> 8); 45 | return 2; 46 | } else 47 | return RET_TOOSMALL; 48 | } 49 | return RET_ILUNI; 50 | } 51 | -------------------------------------------------------------------------------- /lib/ucs2swapped.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UCS-2-SWAPPED = UCS-2-INTERNAL with inverted endianness 22 | */ 23 | 24 | static int 25 | ucs2swapped_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | /* This function assumes that 'unsigned short' has exactly 16 bits. */ 28 | if (sizeof(unsigned short) != 2) abort(); 29 | 30 | if (n >= 2) { 31 | unsigned short x = *(const unsigned short *)s; 32 | x = (x >> 8) | (x << 8); 33 | if (x >= 0xd800 && x < 0xe000) { 34 | return RET_ILSEQ; 35 | } else { 36 | *pwc = x; 37 | return 2; 38 | } 39 | } 40 | return RET_TOOFEW(0); 41 | } 42 | 43 | static int 44 | ucs2swapped_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 45 | { 46 | /* This function assumes that 'unsigned short' has exactly 16 bits. */ 47 | if (sizeof(unsigned short) != 2) abort(); 48 | 49 | if (wc < 0x10000 && !(wc >= 0xd800 && wc < 0xe000)) { 50 | if (n >= 2) { 51 | unsigned short x = wc; 52 | x = (x >> 8) | (x << 8); 53 | *(unsigned short *)r = x; 54 | return 2; 55 | } else 56 | return RET_TOOSMALL; 57 | } else 58 | return RET_ILUNI; 59 | } 60 | -------------------------------------------------------------------------------- /lib/ucs4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2008, 2011, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UCS-4 22 | */ 23 | 24 | /* Here we accept FFFE0000/0000FEFF marks as endianness indicators everywhere 25 | in the stream, not just at the beginning. The default is big-endian. */ 26 | /* The state is 0 if big-endian, 1 if little-endian. */ 27 | static int 28 | ucs4_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 29 | { 30 | state_t state = conv->istate; 31 | int count = 0; 32 | for (; n >= 4 && count <= RET_COUNT_MAX && count <= INT_MAX-4;) { 33 | ucs4_t wc = (state 34 | ? s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24) 35 | : (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3]); 36 | if (wc == 0x0000feff) { 37 | } else if (wc == 0xfffe0000u) { 38 | state ^= 1; 39 | } else if (wc <= 0x7fffffff) { 40 | *pwc = wc; 41 | conv->istate = state; 42 | return count+4; 43 | } else { 44 | conv->istate = state; 45 | return RET_SHIFT_ILSEQ(count); 46 | } 47 | s += 4; n -= 4; count += 4; 48 | } 49 | conv->istate = state; 50 | return RET_TOOFEW(count); 51 | } 52 | 53 | /* But we output UCS-4 in big-endian order, without byte-order mark. */ 54 | static int 55 | ucs4_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 56 | { 57 | if (wc <= 0x7fffffff) { 58 | if (n >= 4) { 59 | r[0] = (unsigned char) (wc >> 24); 60 | r[1] = (unsigned char) (wc >> 16); 61 | r[2] = (unsigned char) (wc >> 8); 62 | r[3] = (unsigned char) wc; 63 | return 4; 64 | } else 65 | return RET_TOOSMALL; 66 | } else 67 | return RET_ILUNI; 68 | } 69 | -------------------------------------------------------------------------------- /lib/ucs4be.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2000, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UCS-4BE = UCS-4 big endian 22 | */ 23 | 24 | static int 25 | ucs4be_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | if (n >= 4) { 28 | *pwc = (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3]; 29 | return 4; 30 | } 31 | return RET_TOOFEW(0); 32 | } 33 | 34 | static int 35 | ucs4be_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 36 | { 37 | if (n >= 4) { 38 | r[0] = (unsigned char) (wc >> 24); 39 | r[1] = (unsigned char) (wc >> 16); 40 | r[2] = (unsigned char) (wc >> 8); 41 | r[3] = (unsigned char) wc; 42 | return 4; 43 | } else 44 | return RET_TOOSMALL; 45 | } 46 | -------------------------------------------------------------------------------- /lib/ucs4internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2000, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UCS-4-INTERNAL = UCS-4 with machine dependent endianness and alignment 22 | */ 23 | 24 | static int 25 | ucs4internal_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | if (n >= 4) { 28 | *pwc = *(const unsigned int *)s; 29 | return 4; 30 | } 31 | return RET_TOOFEW(0); 32 | } 33 | 34 | static int 35 | ucs4internal_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 36 | { 37 | if (n >= 4) { 38 | *(unsigned int *)r = wc; 39 | return 4; 40 | } else 41 | return RET_TOOSMALL; 42 | } 43 | -------------------------------------------------------------------------------- /lib/ucs4le.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2000, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UCS-4LE = UCS-4 little endian 22 | */ 23 | 24 | static int 25 | ucs4le_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | if (n >= 4) { 28 | *pwc = s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24); 29 | return 4; 30 | } 31 | return RET_TOOFEW(0); 32 | } 33 | 34 | static int 35 | ucs4le_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 36 | { 37 | if (n >= 4) { 38 | r[0] = (unsigned char) wc; 39 | r[1] = (unsigned char) (wc >> 8); 40 | r[2] = (unsigned char) (wc >> 16); 41 | r[3] = (unsigned char) (wc >> 24); 42 | return 4; 43 | } else 44 | return RET_TOOSMALL; 45 | } 46 | -------------------------------------------------------------------------------- /lib/ucs4swapped.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2000, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UCS-4-SWAPPED = UCS-4-INTERNAL with inverted endianness 22 | */ 23 | 24 | static int 25 | ucs4swapped_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 26 | { 27 | /* This function assumes that 'unsigned int' has exactly 32 bits. */ 28 | if (sizeof(unsigned int) != 4) abort(); 29 | 30 | if (n >= 4) { 31 | unsigned int x = *(const unsigned int *)s; 32 | x = (x >> 24) | ((x >> 8) & 0xff00) | ((x & 0xff00) << 8) | (x << 24); 33 | *pwc = x; 34 | return 4; 35 | } 36 | return RET_TOOFEW(0); 37 | } 38 | 39 | static int 40 | ucs4swapped_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 41 | { 42 | /* This function assumes that 'unsigned int' has exactly 32 bits. */ 43 | if (sizeof(unsigned int) != 4) abort(); 44 | 45 | if (n >= 4) { 46 | unsigned int x = wc; 47 | x = (x >> 24) | ((x >> 8) & 0xff00) | ((x & 0xff00) << 8) | (x << 24); 48 | *(unsigned int *)r = x; 49 | return 4; 50 | } else 51 | return RET_TOOSMALL; 52 | } 53 | -------------------------------------------------------------------------------- /lib/utf16be.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2008, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UTF-16BE 22 | */ 23 | 24 | /* Specification: RFC 2781 */ 25 | 26 | static int 27 | utf16be_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 28 | { 29 | int count = 0; 30 | if (n >= 2) { 31 | ucs4_t wc = (s[0] << 8) + s[1]; 32 | if (wc >= 0xd800 && wc < 0xdc00) { 33 | if (n >= 4) { 34 | ucs4_t wc2 = (s[2] << 8) + s[3]; 35 | if (!(wc2 >= 0xdc00 && wc2 < 0xe000)) 36 | goto ilseq; 37 | *pwc = 0x10000 + ((wc - 0xd800) << 10) + (wc2 - 0xdc00); 38 | return count+4; 39 | } 40 | } else if (wc >= 0xdc00 && wc < 0xe000) { 41 | goto ilseq; 42 | } else { 43 | *pwc = wc; 44 | return count+2; 45 | } 46 | } 47 | return RET_TOOFEW(count); 48 | 49 | ilseq: 50 | return RET_SHIFT_ILSEQ(count); 51 | } 52 | 53 | static int 54 | utf16be_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 55 | { 56 | if (!(wc >= 0xd800 && wc < 0xe000)) { 57 | if (wc < 0x10000) { 58 | if (n >= 2) { 59 | r[0] = (unsigned char) (wc >> 8); 60 | r[1] = (unsigned char) wc; 61 | return 2; 62 | } else 63 | return RET_TOOSMALL; 64 | } 65 | else if (wc < 0x110000) { 66 | if (n >= 4) { 67 | ucs4_t wc1 = 0xd800 + ((wc - 0x10000) >> 10); 68 | ucs4_t wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff); 69 | r[0] = (unsigned char) (wc1 >> 8); 70 | r[1] = (unsigned char) wc1; 71 | r[2] = (unsigned char) (wc2 >> 8); 72 | r[3] = (unsigned char) wc2; 73 | return 4; 74 | } else 75 | return RET_TOOSMALL; 76 | } 77 | } 78 | return RET_ILUNI; 79 | } 80 | -------------------------------------------------------------------------------- /lib/utf16le.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2008, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UTF-16LE 22 | */ 23 | 24 | /* Specification: RFC 2781 */ 25 | 26 | static int 27 | utf16le_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 28 | { 29 | int count = 0; 30 | if (n >= 2) { 31 | ucs4_t wc = s[0] + (s[1] << 8); 32 | if (wc >= 0xd800 && wc < 0xdc00) { 33 | if (n >= 4) { 34 | ucs4_t wc2 = s[2] + (s[3] << 8); 35 | if (!(wc2 >= 0xdc00 && wc2 < 0xe000)) 36 | goto ilseq; 37 | *pwc = 0x10000 + ((wc - 0xd800) << 10) + (wc2 - 0xdc00); 38 | return count+4; 39 | } 40 | } else if (wc >= 0xdc00 && wc < 0xe000) { 41 | goto ilseq; 42 | } else { 43 | *pwc = wc; 44 | return count+2; 45 | } 46 | } 47 | return RET_TOOFEW(count); 48 | 49 | ilseq: 50 | return RET_SHIFT_ILSEQ(count); 51 | } 52 | 53 | static int 54 | utf16le_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 55 | { 56 | if (!(wc >= 0xd800 && wc < 0xe000)) { 57 | if (wc < 0x10000) { 58 | if (n >= 2) { 59 | r[0] = (unsigned char) wc; 60 | r[1] = (unsigned char) (wc >> 8); 61 | return 2; 62 | } else 63 | return RET_TOOSMALL; 64 | } 65 | else if (wc < 0x110000) { 66 | if (n >= 4) { 67 | ucs4_t wc1 = 0xd800 + ((wc - 0x10000) >> 10); 68 | ucs4_t wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff); 69 | r[0] = (unsigned char) wc1; 70 | r[1] = (unsigned char) (wc1 >> 8); 71 | r[2] = (unsigned char) wc2; 72 | r[3] = (unsigned char) (wc2 >> 8); 73 | return 4; 74 | } else 75 | return RET_TOOSMALL; 76 | } 77 | } 78 | return RET_ILUNI; 79 | } 80 | -------------------------------------------------------------------------------- /lib/utf32be.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UTF-32BE 22 | */ 23 | 24 | /* Specification: Unicode 3.1 Standard Annex #19 */ 25 | 26 | static int 27 | utf32be_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 28 | { 29 | if (n >= 4) { 30 | ucs4_t wc = (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3]; 31 | if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) { 32 | *pwc = wc; 33 | return 4; 34 | } else 35 | return RET_ILSEQ; 36 | } 37 | return RET_TOOFEW(0); 38 | } 39 | 40 | static int 41 | utf32be_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 42 | { 43 | if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) { 44 | if (n >= 4) { 45 | r[0] = 0; 46 | r[1] = (unsigned char) (wc >> 16); 47 | r[2] = (unsigned char) (wc >> 8); 48 | r[3] = (unsigned char) wc; 49 | return 4; 50 | } else 51 | return RET_TOOSMALL; 52 | } 53 | return RET_ILUNI; 54 | } 55 | -------------------------------------------------------------------------------- /lib/utf32le.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. 3 | * This file is part of the GNU LIBICONV Library. 4 | * 5 | * The GNU LIBICONV Library is free software; you can redistribute it 6 | * and/or modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * The GNU LIBICONV Library is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the GNU LIBICONV Library; see the file COPYING.LIB. 17 | * If not, see . 18 | */ 19 | 20 | /* 21 | * UTF-32LE 22 | */ 23 | 24 | /* Specification: Unicode 3.1 Standard Annex #19 */ 25 | 26 | static int 27 | utf32le_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) 28 | { 29 | if (n >= 4) { 30 | ucs4_t wc = s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24); 31 | if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) { 32 | *pwc = wc; 33 | return 4; 34 | } else 35 | return RET_ILSEQ; 36 | } 37 | return RET_TOOFEW(0); 38 | } 39 | 40 | static int 41 | utf32le_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) 42 | { 43 | if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) { 44 | if (n >= 4) { 45 | r[0] = (unsigned char) wc; 46 | r[1] = (unsigned char) (wc >> 8); 47 | r[2] = (unsigned char) (wc >> 16); 48 | r[3] = 0; 49 | return 4; 50 | } else 51 | return RET_TOOSMALL; 52 | } 53 | return RET_ILUNI; 54 | } 55 | -------------------------------------------------------------------------------- /libcharset/AUTHORS: -------------------------------------------------------------------------------- 1 | Bruno Haible 2 | -------------------------------------------------------------------------------- /libcharset/DEPENDENCIES: -------------------------------------------------------------------------------- 1 | No packages need to be installed before GNU libcharset is installed. 2 | -------------------------------------------------------------------------------- /libcharset/HACKING: -------------------------------------------------------------------------------- 1 | All you need to know when hacking (modifying) GNU libcharset or when building 2 | it off the Git repository. 3 | 4 | 5 | Requirements 6 | ============ 7 | 8 | You will need reasonably recent versions of the build tools: 9 | 10 | * A C compiler. Such as GNU GCC. 11 | + Homepage: 12 | https://gcc.gnu.org/ 13 | 14 | * GNU autoconf 15 | + Homepage: 16 | https://www.gnu.org/software/autoconf/ 17 | 18 | * GNU m4 19 | + Homepage: 20 | https://www.gnu.org/software/m4/ 21 | 22 | * Perl 23 | + Homepage: 24 | https://www.perl.org/ 25 | 26 | And, of course, the packages listed in the DEPENDENCIES file. 27 | 28 | 29 | Building off the Git repository 30 | =============================== 31 | 32 | Access to the Git repository is described at 33 | https://savannah.gnu.org/git/?group=libiconv . 34 | 35 | After fetching the sources from the Git repository, peek at the comments in 36 | autogen.sh, then run "./autogen.sh"; then you can proceed with "./configure" 37 | as usual. 38 | 39 | -------------------------------------------------------------------------------- /libcharset/INSTALL.windows: -------------------------------------------------------------------------------- 1 | Installation on Microsoft Windows: 2 | 3 | See the file INSTALL.windows in the top-level directory of this package. 4 | -------------------------------------------------------------------------------- /libcharset/INTEGRATE: -------------------------------------------------------------------------------- 1 | Integration of this library into your package: 2 | 3 | The preferred way is to use the Gnulib module 'localcharset'. 4 | 5 | Here are instructions if you don't want to use Gnulib. It's tedious, 6 | many small changes to your package: 7 | 8 | * Copy the lib/ source file (localcharset.c) and the include file 9 | (include/localcharset.h) into your package. 10 | 11 | * Add the m4/ files (codeset.m4, fcntl_h.m4) to your aclocal.m4 file 12 | or, if you are using automake, to your m4/ directory. 13 | 14 | * Add the following lines to your configure.ac file: 15 | 16 | AC_CANONICAL_HOST 17 | AM_LANGINFO_CODESET 18 | gl_FCNTL_O_FLAGS 19 | AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) 20 | 21 | and make sure that it sets and AC_SUBSTs the PACKAGE variable. 22 | 23 | * If you are not using automake, add rules to your Makefile.in: 24 | 25 | - Augment target "all" by 26 | localcharset.o 27 | 28 | * If you are using automake, add rules to your Makefile.am: 29 | 30 | - Augment the main *_SOURCES variable by 31 | 32 | localcharset.h localcharset.c 33 | 34 | -------------------------------------------------------------------------------- /libcharset/Makefile.devel: -------------------------------------------------------------------------------- 1 | # This is the developer's makefile, not the user's makefile. 2 | # Don't use it unless you know exactly what you do! 3 | 4 | SHELL = /bin/sh 5 | MAKE = make 6 | AUTOCONF = autoconf 7 | AUTOHEADER = autoheader 8 | ACLOCAL = aclocal-1.16 9 | CP = cp 10 | RM = rm -f 11 | 12 | all : configures include/libcharset.h.build.in include/localcharset.h.build.in 13 | 14 | autoconf/aclocal.m4 : $(wildcard m4/*.m4) 15 | test -d autoconf || mkdir autoconf 16 | $(ACLOCAL) -I m4 --output=$@ && rm -rf autom4te.cache 17 | 18 | configures : configure config.h.in 19 | 20 | configure : configure.ac autoconf/aclocal.m4 21 | $(AUTOCONF) --include autoconf && rm -rf autom4te.cache 22 | 23 | config.h.in : configure.ac autoconf/aclocal.m4 24 | $(AUTOHEADER) --include autoconf && rm -rf autom4te.cache 25 | touch config.h.in 26 | 27 | include/libcharset.h.build.in : include/libcharset.h.in include/export.h 28 | sed -e 's/extern \([^"]\)/extern LIBCHARSET_DLL_EXPORTED \1/' \ 29 | -e '/#define _LIBCHARSET_H/r include/export.h' \ 30 | < $< > $@ 31 | 32 | include/localcharset.h.build.in : include/localcharset.h.in include/export.h 33 | sed -e 's/extern \([^"]\)/extern LIBCHARSET_DLL_EXPORTED \1/' \ 34 | -e '/#define _LOCALCHARSET_H/r include/export.h' \ 35 | < $< > $@ 36 | 37 | totally-clean : force 38 | rm -f autoconf/aclocal.m4 configure config.h.in include/libcharset.h.build.in include/localcharset.h.build.in 39 | 40 | force : 41 | -------------------------------------------------------------------------------- /libcharset/NEWS: -------------------------------------------------------------------------------- 1 | New in 1.5: 2 | * Fixed a multithread-safety bug on Cygwin and native Windows. 3 | 4 | New in 1.4: 5 | * Tidy up the list of symbols exported from libcharset (assumes gcc >= 4.0). 6 | 7 | New in 1.2: 8 | * The include file is renamed from "libcharset.h" to "localcharset.h". 9 | -------------------------------------------------------------------------------- /libcharset/README: -------------------------------------------------------------------------------- 1 | LIBCHARSET - portable character set determination library 2 | 3 | This library provides a function which determines the character set / encoding 4 | of text in the currently selected locale (the LC_CTYPE locale facet). 5 | 6 | It is useful for portable programs which need to process text in other 7 | encodings and locales than the currently selected one. Possible uses: 8 | 9 | * Use of Unicode in POSIX compliant applications. 10 | * Conversion of text between the current locale's encoding and UTF-8 (or 11 | any other given encoding). 12 | * Mail agents. 13 | 14 | In theory, this would be very simple: POSIX provides the nl_langinfo function, 15 | in such a way that 16 | 17 | nl_langinfo (CODESET) 18 | 19 | returns the encoding name. But the nl_langinfo function still does not exist 20 | on some systems, and on those where it exists it returns unstandardized 21 | variations of the encoding names, like (on Solaris) "PCK" for "Shift_JIS". 22 | 23 | This library fixes these flaws and provides a function 24 | 25 | const char * locale_charset (void); 26 | 27 | It determines the current locale's character encoding, and canonicalizes it 28 | into one of the canonical names listed in localcharset.h. The result must 29 | not be freed; it is statically allocated. If the canonical name cannot be 30 | determined, the result is a non-canonical name. 31 | 32 | 33 | Installation: 34 | 35 | As usual for GNU packages: 36 | 37 | $ ./configure --prefix=/usr/local 38 | $ make 39 | $ make install 40 | 41 | 42 | This library is used in 43 | GNU coreutils 44 | GNU gettext 45 | GNU clisp 46 | 47 | 48 | To integrate this library into your package: 49 | - Either from this package. See file INTEGRATE. 50 | - Or from gnulib. See 51 | 52 | 53 | 54 | Distribution: 55 | The libcharset directory of 56 | ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz 57 | 58 | Homepage: 59 | https://haible.de/bruno/packages-libcharset.html 60 | 61 | 62 | Bruno Haible 63 | -------------------------------------------------------------------------------- /libcharset/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Convenience script for regenerating all aclocal.m4, config.h.in, Makefile.in, 3 | # configure files with new versions of autoconf or automake. 4 | # 5 | # This script requires autoconf-2.63..2.71 and automake-1.11..1.16 in the PATH. 6 | 7 | # Copyright (C) 2003-2007, 2009-2010, 2016, 2020-2021 Free Software Foundation, Inc. 8 | # 9 | # This program is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | # Usage: ./autogen.sh 23 | 24 | make -f Makefile.devel totally-clean all 25 | -------------------------------------------------------------------------------- /libcharset/configure.ac: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2000-2003, 2005-2009, 2016, 2018-2020 Free Software Foundation, Inc. 2 | dnl This file is part of the GNU CHARSET Library. 3 | dnl 4 | dnl The GNU CHARSET Library is free software; you can redistribute it and/or 5 | dnl modify it under the terms of the GNU Lesser General Public License as 6 | dnl published by the Free Software Foundation; either version 2 of the 7 | dnl License, or (at your option) any later version. 8 | dnl 9 | dnl The GNU CHARSET Library is distributed in the hope that it will be useful, 10 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | dnl Lesser General Public License for more details. 13 | dnl 14 | dnl You should have received a copy of the GNU Lesser General Public License 15 | dnl along with the GNU CHARSET Library; see the file COPYING.LIB. If not, 16 | dnl see . 17 | 18 | AC_PREREQ([2.64]) 19 | AC_INIT([libcharset], [1.5]) 20 | AC_CONFIG_SRCDIR([lib/localcharset.c]) 21 | AC_CONFIG_AUX_DIR([build-aux]) 22 | AC_CONFIG_HEADERS([config.h]) 23 | AC_PROG_MAKE_SET 24 | 25 | dnl checks for basic programs 26 | 27 | AC_PROG_CC 28 | AC_PROG_CPP 29 | AC_PROG_INSTALL 30 | 31 | dnl check for host type 32 | 33 | AC_CANONICAL_HOST 34 | 35 | dnl checks for installer options 36 | 37 | dnl checks for programs 38 | 39 | dnl checks for UNIX variants that set DEFS 40 | 41 | AC_USE_SYSTEM_EXTENSIONS 42 | 43 | dnl checks for compiler output filename suffixes 44 | 45 | AC_OBJEXT 46 | AC_EXEEXT 47 | 48 | dnl checks for build configuration 49 | 50 | LT_INIT([win32-dll]) 51 | gl_RELOCATABLE 52 | gl_VISIBILITY 53 | 54 | dnl checks for header files and functions 55 | 56 | AM_LANGINFO_CODESET 57 | gl_FCNTL_O_FLAGS 58 | AC_CHECK_FUNCS([setlocale]) 59 | 60 | AC_CONFIG_FILES([Makefile]) 61 | AC_CONFIG_FILES([lib/Makefile]) 62 | AC_CONFIG_FILES([include/libcharset.h:include/libcharset.h.build.in]) 63 | AC_CONFIG_FILES([include/libcharset.h.inst:include/libcharset.h.in]) 64 | AC_CONFIG_FILES([include/localcharset.h:include/localcharset.h.build.in]) 65 | AC_CONFIG_FILES([include/localcharset.h.inst:include/localcharset.h.in]) 66 | AC_OUTPUT 67 | -------------------------------------------------------------------------------- /libcharset/include/export.h: -------------------------------------------------------------------------------- 1 | 2 | #if @HAVE_VISIBILITY@ && BUILDING_LIBCHARSET 3 | #define LIBCHARSET_DLL_EXPORTED __attribute__((__visibility__("default"))) 4 | #elif defined _MSC_VER && BUILDING_LIBCHARSET 5 | #define LIBCHARSET_DLL_EXPORTED __declspec(dllexport) 6 | #else 7 | #define LIBCHARSET_DLL_EXPORTED 8 | #endif 9 | -------------------------------------------------------------------------------- /libcharset/include/libcharset.h.in: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2003 Free Software Foundation, Inc. 2 | This file is part of the GNU CHARSET Library. 3 | 4 | The GNU CHARSET Library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public License as 6 | published by the Free Software Foundation; either version 2 of the 7 | License, or (at your option) any later version. 8 | 9 | The GNU CHARSET Library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with the GNU CHARSET Library; see the file COPYING.LIB. If not, 16 | see . */ 17 | 18 | #ifndef _LIBCHARSET_H 19 | #define _LIBCHARSET_H 20 | 21 | #include 22 | 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | 29 | /* Support for relocatable packages. */ 30 | 31 | /* Sets the original and the current installation prefix of the package. 32 | Relocation simply replaces a pathname starting with the original prefix 33 | by the corresponding pathname with the current prefix instead. Both 34 | prefixes should be directory names without trailing slash (i.e. use "" 35 | instead of "/"). */ 36 | extern void libcharset_set_relocation_prefix (const char *orig_prefix, 37 | const char *curr_prefix); 38 | 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | 45 | #endif /* _LIBCHARSET_H */ 46 | -------------------------------------------------------------------------------- /libcharset/lib/relocatable-stub.c: -------------------------------------------------------------------------------- 1 | /* Provide relocatable packages. 2 | Copyright (C) 2018 Free Software Foundation, Inc. 3 | Written by Bruno Haible , 2018. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Lesser General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, see . */ 17 | 18 | #include 19 | 20 | #include "libcharset.h" 21 | 22 | extern LIBCHARSET_DLL_EXPORTED void 23 | libcharset_set_relocation_prefix (const char *orig_prefix, const char *curr_prefix); 24 | 25 | /* This is a stub for binary backward-compatibility. */ 26 | void 27 | libcharset_set_relocation_prefix (const char *orig_prefix, const char *curr_prefix) 28 | { 29 | } 30 | -------------------------------------------------------------------------------- /libcharset/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, 4 | # Inc. 5 | # Written by Scott James Remnant, 2004 6 | # 7 | # This file is free software; the Free Software Foundation gives 8 | # unlimited permission to copy and/or distribute it, with or without 9 | # modifications, as long as this notice is preserved. 10 | 11 | # @configure_input@ 12 | 13 | # serial 4245 ltversion.m4 14 | # This file is part of GNU Libtool 15 | 16 | m4_define([LT_PACKAGE_VERSION], [2.4.7]) 17 | m4_define([LT_PACKAGE_REVISION], [2.4.7]) 18 | 19 | AC_DEFUN([LTVERSION_VERSION], 20 | [macro_version='2.4.7' 21 | macro_revision='2.4.7' 22 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 23 | _LT_DECL(, macro_revision, 0) 24 | ]) 25 | -------------------------------------------------------------------------------- /libcharset/tools/README: -------------------------------------------------------------------------------- 1 | This directory contains tools for maintaining the tables in the localcharset.c 2 | file. 3 | 4 | The main script is "all-charsets". Before using it, you must configure 5 | this package. For all installed locales, it prints 6 | - the result of the command "locale charmap", 7 | - the result of "nl_langinfo (CODESET)", 8 | - the result of "locale_charset ()". 9 | 10 | It uses the following auxiliary scripts and programs: 11 | - all-locales 12 | Prints all usable locales in the system, one per line. 13 | - locale_charmap 14 | Executes "locale charmap". 15 | - locale_codeset.c 16 | Prints nl_langinfo (CODESET). 17 | - locale_charset.c 18 | Prints locale_charset(). 19 | 20 | A second main script is "all-charsets-X11". It also prints the X11 21 | encoding name. Before using it, you must tweak the X11 paths needed 22 | for compiling locale_x11encoding (a simple X11 program), and let your 23 | DISPLAY environment variable point to a running X11 screen. 24 | 25 | The other files are test results from various operating systems. 26 | 27 | -------------------------------------------------------------------------------- /libcharset/tools/aix-3.2.5: -------------------------------------------------------------------------------- 1 | locale_charset.c: 2 | ../../lib/localcharset.c: 3 | locale name locale charmap nl_langinfo(CODESET) locale_charset() 4 | 5 | En_US.IBM-850 IBM-850 IBM-850 CP850 6 | Fr_FR.IBM-850 IBM-850 IBM-850 CP850 7 | en_US.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 8 | fr_FR.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 9 | -------------------------------------------------------------------------------- /libcharset/tools/all-charsets: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Prints a table of the charsets (system dependent name and portable name) 4 | # for all locales. 5 | 6 | ${CC-cc} -o locale_codeset locale_codeset.c 7 | ${CC-cc} -o locale_charset -I../include locale_charset.c \ 8 | -DHAVE_CONFIG_H -I.. -DLIBDIR='"'`cd ../lib && pwd`'"' \ 9 | ../lib/localcharset.c 10 | 11 | printf '%-15s%-17s%-17s %-17s\n\n' \ 12 | "locale name" "locale charmap" "nl_langinfo(CODESET)" "locale_charset()" 13 | for lc in `./all-locales | sort | uniq` 14 | do 15 | charmap=`LC_ALL=$lc ./locale_charmap 2>/dev/null || echo ''` 16 | codeset=`LC_ALL=$lc ./locale_codeset 2>/dev/null || echo ''` 17 | charset=`LC_ALL=$lc ./locale_charset 2>/dev/null || echo ''` 18 | case "$charset" in 19 | ASCII | ANSI_X3.4-1968 | \ 20 | ISO-8859-1 | ISO-8859-2 | ISO-8859-3 | ISO-8859-4 | ISO-8859-5 | ISO-8859-6 | \ 21 | ISO-8859-7 | ISO-8859-8 | ISO-8859-9 | ISO-8859-13 | ISO-8859-14 | ISO-8859-15 | \ 22 | KOI8-R | KOI8-U | KOI8-T | \ 23 | CP437 | CP775 | CP850 | CP852 | CP855 | CP856 | CP857 | CP861 | CP862 | CP864 | CP865 | CP866 | CP869 | CP874 | CP922 | CP932 | CP943 | CP949 | CP950 | CP1046 | CP1124 | CP1125 | CP1129 | CP1131 | \ 24 | CP1250 | CP1251 | CP1252 | CP1253 | CP1254 | CP1255 | CP1256 | CP1257 | \ 25 | GB2312 | EUC-JP | EUC-KR | EUC-TW | BIG5 | BIG5-HKSCS | GBK | GB18030 | SHIFT_JIS | JOHAB | \ 26 | TIS-620 | VISCII | TCVN5712-1 | ARMSCII-8 | GEORGIAN-PS | PT154 | \ 27 | HP-ROMAN8 | HP-ARABIC8 | HP-GREEK8 | HP-HEBREW8 | HP-TURKISH8 | HP-KANA8 | \ 28 | DEC-KANJI | DEC-HANYU | \ 29 | UTF-8 ) comment="";; 30 | * ) comment="bug";; 31 | esac 32 | printf '%-15s %-17s %-17s %-17s %s\n' \ 33 | "$lc" "$charmap" "$codeset" "$charset" "$comment" 34 | done 35 | -------------------------------------------------------------------------------- /libcharset/tools/all-charsets-X11: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Prints a table of the charsets (system dependent name, portable name, and 4 | # X11 name) for all locales. 5 | 6 | ${CC-cc} -o locale_codeset locale_codeset.c 7 | ${CC-cc} -o locale_charset -I../include locale_charset.c \ 8 | -DHAVE_CONFIG_H -I.. -DLIBDIR='"'`cd ../lib && pwd`'"' \ 9 | ../lib/localcharset.c 10 | ${CC-cc} -o locale_x11encoding locale_x11encoding.c \ 11 | -I/usr/X11R6/include \ 12 | -L/usr/X11R6/lib -lX11 13 | #${CC-cc} -o locale_x11encoding locale_x11encoding.c \ 14 | # -I/packages/gnu/XFree86/include \ 15 | # -L/packages/gnu/XFree86/lib -lX11 \ 16 | # -Wl,-rpath,/packages/gnu/XFree86/lib 17 | 18 | printf '%-15s%-17s%-17s %-17s %-17s\n\n' \ 19 | "locale name" "locale charmap" "nl_langinfo(CODESET)" "locale_charset()" "X11 encoding" 20 | for lc in `./all-locales | sort | uniq` 21 | do 22 | charmap=`LC_ALL=$lc ./locale_charmap 2>/dev/null || echo ''` 23 | codeset=`LC_ALL=$lc ./locale_codeset 2>/dev/null || echo ''` 24 | charset=`LC_ALL=$lc ./locale_charset 2>/dev/null || echo ''` 25 | x11encoding=`LC_ALL=$lc ./locale_x11encoding 2>/dev/null || echo ''` 26 | printf '%-15s %-17s %-17s %-17s %-17s\n' \ 27 | "$lc" "$charmap" "$codeset" "$charset" "$x11encoding" 28 | done 29 | -------------------------------------------------------------------------------- /libcharset/tools/all-locales: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Prints the list of all locale names, one per line. 3 | 4 | locale -a 5 | test $? = 0 && exit 0 6 | 7 | host=`/bin/sh ../build-aux/config.guess` 8 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 9 | host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` 10 | host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` 11 | 12 | case "$host_os" in 13 | sunos* | solaris*) 14 | cd /usr/lib/locale && ls -1 15 | ;; 16 | freebsd*) 17 | cd /usr/share/locale && ls -1 18 | ;; 19 | darwin* | openbsd*) 20 | echo C 21 | cd /usr/share/locale && ls -1 */LC_CTYPE | sed -e 's,/LC_CTYPE$,,' 22 | ;; 23 | *) 24 | echo "Don't know how to determine list of locales on $host_os" 1>&2 25 | exit 1 26 | ;; 27 | esac 28 | -------------------------------------------------------------------------------- /libcharset/tools/beos-5: -------------------------------------------------------------------------------- 1 | locale name locale charmap nl_langinfo(CODESET) locale_charset() 2 | 3 | C UTF-8 4 | -------------------------------------------------------------------------------- /libcharset/tools/cygwin-1.7.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/libcharset/tools/cygwin-1.7.2 -------------------------------------------------------------------------------- /libcharset/tools/glibc-2.1.3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/libcharset/tools/glibc-2.1.3 -------------------------------------------------------------------------------- /libcharset/tools/glibc-2.1.90: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/libcharset/tools/glibc-2.1.90 -------------------------------------------------------------------------------- /libcharset/tools/glibc-2.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/libcharset/tools/glibc-2.2 -------------------------------------------------------------------------------- /libcharset/tools/glibc-2.2-XF86-3.3.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/libcharset/tools/glibc-2.2-XF86-3.3.6 -------------------------------------------------------------------------------- /libcharset/tools/glibc-2.2-XF86-4.0.1f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/libcharset/tools/glibc-2.2-XF86-4.0.1f -------------------------------------------------------------------------------- /libcharset/tools/irix-6.5: -------------------------------------------------------------------------------- 1 | locale name locale charmap nl_langinfo(CODESET) locale_charset() 2 | 3 | C ISO8859-1 ISO8859-1 ISO-8859-1 4 | POSIX ISO8859-1 ISO8859-1 ISO-8859-1 5 | charmap ISO8859-1 ISO8859-1 ISO-8859-1 6 | cs ISO8859-2 ISO8859-2 ISO-8859-2 7 | da ISO8859-1 ISO8859-1 ISO-8859-1 8 | de ISO8859-1 ISO8859-1 ISO-8859-1 9 | de_AT ISO8859-1 ISO8859-1 ISO-8859-1 10 | de_CH ISO8859-1 ISO8859-1 ISO-8859-1 11 | el ISO8859-7 ISO8859-7 ISO-8859-7 12 | en ISO8859-1 ISO8859-1 ISO-8859-1 13 | en_AU ISO8859-1 ISO8859-1 ISO-8859-1 14 | en_CA ISO8859-1 ISO8859-1 ISO-8859-1 15 | en_FR ISO8859-1 ISO8859-1 ISO-8859-1 16 | en_US ISO8859-1 ISO8859-1 ISO-8859-1 17 | es ISO8859-1 ISO8859-1 ISO-8859-1 18 | es_AR ISO8859-1 ISO8859-1 ISO-8859-1 19 | es_MX ISO8859-1 ISO8859-1 ISO-8859-1 20 | fi ISO8859-1 ISO8859-1 ISO-8859-1 21 | fr ISO8859-1 ISO8859-1 ISO-8859-1 22 | fr_BE ISO8859-1 ISO8859-1 ISO-8859-1 23 | fr_CA ISO8859-1 ISO8859-1 ISO-8859-1 24 | fr_CH ISO8859-1 ISO8859-1 ISO-8859-1 25 | hu ISO8859-2 ISO8859-2 ISO-8859-2 26 | is ISO8859-1 ISO8859-1 ISO-8859-1 27 | it ISO8859-1 ISO8859-1 ISO-8859-1 28 | it_CH ISO8859-1 ISO8859-1 ISO-8859-1 29 | ja_JP.EUC eucJP eucJP EUC-JP 30 | ko_KR.euc eucKR eucKR EUC-KR 31 | nl ISO8859-1 ISO8859-1 ISO-8859-1 32 | nl_BE ISO8859-1 ISO8859-1 ISO-8859-1 33 | no ISO8859-1 ISO8859-1 ISO-8859-1 34 | pl ISO8859-2 ISO8859-2 ISO-8859-2 35 | pt ISO8859-1 ISO8859-1 ISO-8859-1 36 | pt_BR ISO8859-1 ISO8859-1 ISO-8859-1 37 | ru ISO8859-5 ISO8859-5 ISO-8859-5 38 | sk ISO8859-2 ISO8859-2 ISO-8859-2 39 | sv ISO8859-1 ISO8859-1 ISO-8859-1 40 | tr ISO8859-9 ISO8859-9 ISO-8859-9 41 | zh_CN.ugb eucCN eucCN EUC-CN 42 | zh_TW.ucns eucTW eucTW EUC-TW 43 | -------------------------------------------------------------------------------- /libcharset/tools/locale_charmap: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Prints the system dependent name for the current locale's charmap. 3 | 4 | locale charmap 5 | -------------------------------------------------------------------------------- /libcharset/tools/locale_charset.c: -------------------------------------------------------------------------------- 1 | /* Prints the portable name for the current locale's charset. */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include "localcharset.h" 7 | 8 | int main () 9 | { 10 | setlocale(LC_ALL, ""); 11 | printf("%s\n", locale_charset()); 12 | exit(0); 13 | } 14 | -------------------------------------------------------------------------------- /libcharset/tools/locale_codeset.c: -------------------------------------------------------------------------------- 1 | /* Prints the system dependent name for the current locale's codeset. */ 2 | 3 | #define _XOPEN_SOURCE 500 /* Needed on AIX 3.2.5 */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | int main () 11 | { 12 | setlocale(LC_ALL, ""); 13 | printf("%s\n", nl_langinfo(CODESET)); 14 | exit(0); 15 | } 16 | -------------------------------------------------------------------------------- /libcharset/tools/locale_monthnames.c: -------------------------------------------------------------------------------- 1 | /* Prints the system dependent names for the 12 months in the current locale. */ 2 | 3 | #define _XOPEN_SOURCE 500 /* Needed on AIX 3.2.5 */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | int main () 11 | { 12 | setlocale(LC_ALL, ""); 13 | printf("%s\n", nl_langinfo(MON_1)); 14 | printf("%s\n", nl_langinfo(MON_2)); 15 | printf("%s\n", nl_langinfo(MON_3)); 16 | printf("%s\n", nl_langinfo(MON_4)); 17 | printf("%s\n", nl_langinfo(MON_5)); 18 | printf("%s\n", nl_langinfo(MON_6)); 19 | printf("%s\n", nl_langinfo(MON_7)); 20 | printf("%s\n", nl_langinfo(MON_8)); 21 | printf("%s\n", nl_langinfo(MON_9)); 22 | printf("%s\n", nl_langinfo(MON_10)); 23 | printf("%s\n", nl_langinfo(MON_11)); 24 | printf("%s\n", nl_langinfo(MON_12)); 25 | exit(0); 26 | } 27 | -------------------------------------------------------------------------------- /libcharset/tools/locale_x11encoding.c: -------------------------------------------------------------------------------- 1 | /* Prints the locale's encoding via libX11. */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | int main (int argc, char* argv[]) 11 | { 12 | Display* display; 13 | XTextProperty textprop; 14 | char* input; 15 | 16 | if (argc != 1) 17 | exit(1); 18 | 19 | setlocale(LC_CTYPE,""); 20 | 21 | display = XOpenDisplay(NULL); 22 | if (display == NULL) { 23 | fprintf(stderr,"cannot open display\n"); 24 | exit(1); 25 | } 26 | 27 | input = ""; 28 | if (XmbTextListToTextProperty(display, &input, 1, XTextStyle, &textprop) != Success) { 29 | fprintf(stderr,"XmbTextListToTextProperty failed\n"); 30 | exit(1); 31 | } 32 | assert(textprop.format == 8); 33 | assert(textprop.nitems == 0); 34 | 35 | printf("%s\n", XGetAtomName(display, textprop.encoding)); 36 | 37 | XCloseDisplay(display); 38 | 39 | exit(0); 40 | } 41 | -------------------------------------------------------------------------------- /libcharset/tools/osf1-4.0a: -------------------------------------------------------------------------------- 1 | locale name locale charmap nl_langinfo(CODESET) locale_charset() 2 | 3 | POSIX ISO8859-1 ISO8859-1 ISO-8859-1 4 | da_DK.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 5 | de_CH.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 6 | de_DE.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 7 | el_GR.ISO8859-7 ISO8859-7 ISO8859-7 ISO-8859-7 8 | en_GB.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 9 | en_US.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 10 | es_ES.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 11 | fi_FI.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 12 | fr_BE.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 13 | fr_CA.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 14 | fr_CH.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 15 | fr_FR.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 16 | is_IS.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 17 | it_IT.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 18 | nl_BE.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 19 | nl_NL.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 20 | no_NO.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 21 | pt_PT.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 22 | sv_SE.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 23 | tr_TR.ISO8859-9 ISO8859-9 ISO8859-9 ISO-8859-9 24 | -------------------------------------------------------------------------------- /libcharset/tools/osf1-4.0d: -------------------------------------------------------------------------------- 1 | locale name locale charmap nl_langinfo(CODESET) locale_charset() 2 | 3 | POSIX ISO8859-1 ISO8859-1 ISO-8859-1 4 | da_DK.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 5 | de_CH.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 6 | de_DE.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 7 | el_GR.ISO8859-7 ISO8859-7 ISO8859-7 ISO-8859-7 8 | en_GB.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 9 | en_US.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 10 | en_US.cp850 cp850 cp850 CP850 11 | es_ES.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 12 | fi_FI.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 13 | fr_BE.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 14 | fr_CA.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 15 | fr_CH.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 16 | fr_FR.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 17 | is_IS.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 18 | it_IT.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 19 | nl_BE.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 20 | nl_NL.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 21 | no_NO.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 22 | pt_PT.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 23 | sv_SE.ISO8859-1 ISO8859-1 ISO8859-1 ISO-8859-1 24 | tr_TR.ISO8859-9 ISO8859-9 ISO8859-9 ISO-8859-9 25 | -------------------------------------------------------------------------------- /libcharset/tools/solaris-2.4: -------------------------------------------------------------------------------- 1 | locale name locale charmap nl_langinfo(CODESET) locale_charset() 2 | 3 | C bug 4 | POSIX bug 5 | de bug 6 | en_US bug 7 | es bug 8 | fr bug 9 | iso_8859_1 bug 10 | it bug 11 | sv bug 12 | -------------------------------------------------------------------------------- /libcharset/tools/sunos-4.1.4: -------------------------------------------------------------------------------- 1 | locale_charset.c: 2 | ../../lib/localcharset.c: 3 | locale name locale charmap nl_langinfo(CODESET) locale_charset() 4 | 5 | C bug 6 | -------------------------------------------------------------------------------- /libcharset/tools/win32: -------------------------------------------------------------------------------- 1 | Documentation mentions: 2 | CP874 3 | CP932 4 | CP936 5 | CP949 6 | CP950 7 | CP1200 - Unicode - UCS-2 or UTF-8 ? 8 | CP1250 9 | CP1251 10 | CP1252 11 | CP1253 12 | CP1254 13 | CP1255 14 | CP1256 15 | CP1257 16 | CP1361 17 | -------------------------------------------------------------------------------- /m4/cp.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 1993-2002 Free Software Foundation, Inc. 2 | dnl This file is free software, distributed under the terms of the GNU 3 | dnl General Public License. As a special exception to the GNU General 4 | dnl Public License, this file may be distributed as part of a program 5 | dnl that contains a configuration script generated by Autoconf, under 6 | dnl the same distribution terms as the rest of that program. 7 | 8 | dnl From Bruno Haible, Marcus Daniels. 9 | 10 | AC_PREREQ(2.13) 11 | 12 | AC_DEFUN([CL_PROG_CP], 13 | [AC_CACHE_CHECK(how to copy files, cl_cv_prog_cp, [ 14 | echo "blabla" > conftest.x 15 | err=`/bin/sh -c "cp -p conftest.x conftest.y 2>&1"` 16 | if test -z "$err"; then 17 | cl_cv_prog_cp='cp -p' 18 | else 19 | cl_cv_prog_cp='cp' 20 | fi 21 | rm -f conftest* 22 | ]) 23 | CP="$cl_cv_prog_cp" 24 | AC_SUBST(CP)dnl 25 | ]) 26 | -------------------------------------------------------------------------------- /m4/eilseq.m4: -------------------------------------------------------------------------------- 1 | #serial 2 2 | 3 | AC_PREREQ([2.61]) 4 | 5 | # The EILSEQ errno value ought to be defined in , according to 6 | # ISO C 99 and POSIX. But some systems (like SunOS 4) don't define it, 7 | # and some systems (like BSD/OS) define it in not . 8 | 9 | # Define EILSEQ as a C macro and as a substituted macro in such a way that 10 | # 1. on all systems, after inclusion of , EILSEQ is usable, 11 | # 2. on systems where EILSEQ is defined elsewhere, we use the same numeric 12 | # value. 13 | 14 | AC_DEFUN([AC_EILSEQ], 15 | [ 16 | AC_REQUIRE([AC_PROG_CC])dnl 17 | 18 | dnl Check for any extra headers that could define EILSEQ. 19 | AC_CHECK_HEADERS([wchar.h]) 20 | 21 | AC_CACHE_CHECK([for EILSEQ], [ac_cv_decl_EILSEQ], [ 22 | AC_EGREP_CPP([yes],[ 23 | #include 24 | #ifdef EILSEQ 25 | yes 26 | #endif 27 | ], [have_eilseq=1]) 28 | if test -n "$have_eilseq"; then 29 | dnl EILSEQ exists in . Don't need to define EILSEQ ourselves. 30 | ac_cv_decl_EILSEQ=yes 31 | else 32 | AC_EGREP_CPP([yes],[ 33 | #include 34 | #if HAVE_WCHAR_H 35 | #include 36 | #endif 37 | #ifdef EILSEQ 38 | yes 39 | #endif 40 | ], [have_eilseq=1]) 41 | if test -n "$have_eilseq"; then 42 | dnl EILSEQ exists in some other system header. 43 | dnl Define it to the same value. 44 | AC_COMPUTE_INT([ac_cv_decl_EILSEQ], [EILSEQ], [ 45 | #include 46 | #if HAVE_WCHAR_H 47 | #include 48 | #endif 49 | /* The following two lines are a workaround against an autoconf-2.52 bug. */ 50 | #include 51 | #include 52 | ]) 53 | else 54 | dnl EILSEQ isn't defined by the system. Define EILSEQ ourselves, but 55 | dnl don't define it as EINVAL, because iconv() callers want to 56 | dnl distinguish EINVAL and EILSEQ. 57 | ac_cv_decl_EILSEQ=ENOENT 58 | fi 59 | fi 60 | ]) 61 | if test "$ac_cv_decl_EILSEQ" != yes; then 62 | AC_DEFINE_UNQUOTED([EILSEQ], [$ac_cv_decl_EILSEQ], 63 | [Define as good substitute value for EILSEQ.]) 64 | EILSEQ="$ac_cv_decl_EILSEQ" 65 | AC_SUBST([EILSEQ]) 66 | fi 67 | ]) 68 | -------------------------------------------------------------------------------- /m4/ln.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 1993-2002 Free Software Foundation, Inc. 2 | dnl This file is free software, distributed under the terms of the GNU 3 | dnl General Public License. As a special exception to the GNU General 4 | dnl Public License, this file may be distributed as part of a program 5 | dnl that contains a configuration script generated by Autoconf, under 6 | dnl the same distribution terms as the rest of that program. 7 | 8 | dnl From Bruno Haible, Marcus Daniels. 9 | 10 | AC_PREREQ(2.13) 11 | 12 | AC_DEFUN([CL_PROG_LN], 13 | [AC_REQUIRE([CL_PROG_CP])dnl 14 | AC_CACHE_CHECK(how to make hard links, cl_cv_prog_LN, [ 15 | rm -f conftestdata conftestfile 16 | echo data > conftestfile 17 | if ln conftestfile conftestdata 2>/dev/null; then 18 | cl_cv_prog_LN=ln 19 | else 20 | cl_cv_prog_LN="$cl_cv_prog_cp" 21 | fi 22 | rm -f conftestdata conftestfile 23 | ]) 24 | LN="$cl_cv_prog_LN" 25 | AC_SUBST(LN)dnl 26 | ]) 27 | 28 | AC_DEFUN([CL_PROG_LN_S], 29 | [AC_REQUIRE([CL_PROG_LN])dnl 30 | dnl Make a symlink if possible; otherwise try a hard link. On filesystems 31 | dnl which support neither symlink nor hard link, use a plain copy. 32 | AC_MSG_CHECKING(whether ln -s works) 33 | AC_CACHE_VAL(cl_cv_prog_LN_S, [ 34 | rm -f conftestdata 35 | if ln -s X conftestdata 2>/dev/null; then 36 | cl_cv_prog_LN_S="ln -s" 37 | else 38 | cl_cv_prog_LN_S="$cl_cv_prog_LN" 39 | fi 40 | rm -f conftestdata 41 | ])dnl 42 | if test "$cl_cv_prog_LN_S" = "ln -s"; then 43 | AC_MSG_RESULT(yes) 44 | else 45 | AC_MSG_RESULT(no) 46 | fi 47 | LN_S="$cl_cv_prog_LN_S" 48 | AC_SUBST(LN_S)dnl 49 | ]) 50 | 51 | AC_DEFUN([CL_PROG_HLN], 52 | [AC_REQUIRE([CL_PROG_LN_S])dnl 53 | dnl SVR4 "ln" makes hard links to symbolic links, instead of resolving the 54 | dnl symbolic link. To avoid this, use the "hln" program. 55 | AC_CACHE_CHECK(how to make hard links to symlinks, cl_cv_prog_hln, [ 56 | cl_cv_prog_hln="ln" 57 | if test "$cl_cv_prog_LN_S" = "ln -s"; then 58 | echo "blabla" > conftest.x 59 | ln -s conftest.x conftest.y 60 | ln conftest.y conftest.z 2>&AC_FD_CC 61 | rm -f conftest.x 62 | if cat conftest.z > /dev/null 2>&1 ; then 63 | # ln is usable. 64 | cl_cv_prog_hln="ln" 65 | else 66 | # conftest.z is a symbolic link to the non-existent conftest.x 67 | cl_cv_prog_hln="hln" 68 | fi 69 | else 70 | # If there are no symbolic links, the problem cannot occur. 71 | cl_cv_prog_hln="ln" 72 | fi 73 | rm -f conftest* 74 | ]) 75 | HLN="$cl_cv_prog_hln" 76 | AC_SUBST(HLN)dnl 77 | ]) 78 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, 4 | # Inc. 5 | # Written by Scott James Remnant, 2004 6 | # 7 | # This file is free software; the Free Software Foundation gives 8 | # unlimited permission to copy and/or distribute it, with or without 9 | # modifications, as long as this notice is preserved. 10 | 11 | # @configure_input@ 12 | 13 | # serial 4245 ltversion.m4 14 | # This file is part of GNU Libtool 15 | 16 | m4_define([LT_PACKAGE_VERSION], [2.4.7]) 17 | m4_define([LT_PACKAGE_REVISION], [2.4.7]) 18 | 19 | AC_DEFUN([LTVERSION_VERSION], 20 | [macro_version='2.4.7' 21 | macro_revision='2.4.7' 22 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 23 | _LT_DECL(, macro_revision, 0) 24 | ]) 25 | -------------------------------------------------------------------------------- /m4/proto.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 1993-2002 Free Software Foundation, Inc. 2 | dnl This file is free software, distributed under the terms of the GNU 3 | dnl General Public License. As a special exception to the GNU General 4 | dnl Public License, this file may be distributed as part of a program 5 | dnl that contains a configuration script generated by Autoconf, under 6 | dnl the same distribution terms as the rest of that program. 7 | 8 | dnl From Bruno Haible, Marcus Daniels. 9 | 10 | AC_PREREQ(2.13) 11 | 12 | dnl CL_PROTO(IDENTIFIER, ACTION-IF-NOT-FOUND, FINAL-PROTOTYPE) 13 | AC_DEFUN([CL_PROTO], 14 | [AC_MSG_CHECKING([for $1 declaration]) 15 | AC_CACHE_VAL(cl_cv_proto_[$1], [$2 16 | cl_cv_proto_$1="$3"]) 17 | cl_cv_proto_$1=`echo "[$]cl_cv_proto_$1" | tr -s ' ' | sed -e 's/( /(/'` 18 | AC_MSG_RESULT([$]{ac_t:- 19 | }[$]cl_cv_proto_$1) 20 | ]) 21 | 22 | dnl CL_PROTO_RET(INCLUDES, DECL, CACHE-ID, TYPE-IF-OK, TYPE-IF-FAILS) 23 | AC_DEFUN([CL_PROTO_RET], 24 | [AC_TRY_COMPILE([$1] 25 | AC_LANG_EXTERN[$2 26 | ], [], $3="$4", $3="$5") 27 | ]) 28 | 29 | dnl CL_PROTO_TRY(INCLUDES, ANSI-DECL, TRAD-DECL, ACTION-IF-OK, ACTION-IF-FAILS) 30 | AC_DEFUN([CL_PROTO_TRY], 31 | [AC_TRY_COMPILE([$1] 32 | AC_LANG_EXTERN 33 | [#if defined(__STDC__) || defined(__cplusplus) 34 | $2 35 | #else 36 | $3 37 | #endif 38 | ], [], [$4], [$5]) 39 | ]) 40 | 41 | dnl CL_PROTO_CONST(INCLUDES, ANSI-DECL, TRAD-DECL, CACHE-ID) 42 | AC_DEFUN([CL_PROTO_CONST], 43 | [CL_PROTO_TRY([$1], [$2], [$3], $4="", $4="const")] 44 | ) 45 | -------------------------------------------------------------------------------- /man/iconv_close.3: -------------------------------------------------------------------------------- 1 | .\" Copyright (c) Free Software Foundation, Inc. 2 | .\" 3 | .\" This is free documentation; you can redistribute it and/or 4 | .\" modify it under the terms of the GNU General Public License as 5 | .\" published by the Free Software Foundation; either version 3 of 6 | .\" the License, or (at your option) any later version. 7 | .\" 8 | .\" References consulted: 9 | .\" GNU glibc-2 source code and manual 10 | .\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html 11 | .\" 12 | .TH ICONV_CLOSE 3 "March 31, 2007" "GNU" "Linux Programmer's Manual" 13 | .SH NAME 14 | iconv_close \- deallocate descriptor for character set conversion 15 | .SH SYNOPSIS 16 | .nf 17 | .B #include 18 | .sp 19 | .BI "int iconv_close (iconv_t " cd ); 20 | .fi 21 | .SH DESCRIPTION 22 | The \fBiconv_close\fP function deallocates a conversion descriptor \fIcd\fP 23 | previously allocated using \fBiconv_open\fP. 24 | .SH "RETURN VALUE" 25 | When successful, the \fBiconv_close\fP function returns 0. In case of error, 26 | it sets \fBerrno\fP and returns \-1. 27 | .SH "CONFORMING TO" 28 | POSIX:2001 29 | .SH "SEE ALSO" 30 | .BR iconv_open (3) 31 | .BR iconv (3) 32 | -------------------------------------------------------------------------------- /man/iconv_open_into.3: -------------------------------------------------------------------------------- 1 | .\" Copyright (c) Free Software Foundation, Inc. 2 | .\" 3 | .\" This is free documentation; you can redistribute it and/or 4 | .\" modify it under the terms of the GNU General Public License as 5 | .\" published by the Free Software Foundation; either version 3 of 6 | .\" the License, or (at your option) any later version. 7 | .\" 8 | .\" References consulted: 9 | .\" iconv.h 10 | .\" 11 | .TH ICONV_OPEN_INTO 3 "September 21, 2008" "GNU" "Linux Programmer's Manual" 12 | .SH NAME 13 | iconv_open_into \- initialize descriptor for character set conversion 14 | .SH SYNOPSIS 15 | .nf 16 | .B #include 17 | .sp 18 | .BI "int iconv_open_into (const char* " tocode ", const char* " fromcode "," 19 | .BI " iconv_allocation_t* " resultp ); 20 | .fi 21 | .SH DESCRIPTION 22 | The \fBiconv_open_into\fP function initializes a conversion descriptor suitable 23 | for converting byte sequences from character encoding \fIfromcode\fP to 24 | character encoding \fItocode\fP. The conversion descriptor is stored in the 25 | memory pointed to by \fIresultp\fP. 26 | .PP 27 | The values permitted for \fIfromcode\fP and \fItocode\fP are the same as for 28 | the function \fBiconv_open\fP. 29 | .PP 30 | After a successful return from this function, \fIresultp\fP can be be used 31 | as an \fBiconv_t\fP object with the \fBiconv\fP function. 32 | .SH "RETURN VALUE" 33 | The \fBiconv_open_into\fP function fills \fB*\fP\fIresultp\fP and returns 0 if 34 | it succeeds. In case of error, it sets \fBerrno\fP and returns \-1. 35 | .SH ERRORS 36 | The following error can occur, among others: 37 | .TP 38 | .B EINVAL 39 | The conversion from \fIfromcode\fP to \fItocode\fP is not supported by the 40 | implementation. 41 | .SH "CONFORMING TO" 42 | This function is implemented only in GNU libiconv and not in other \fBiconv\fP 43 | implementations. It is not backed by a standard. You can test for its presence 44 | through \fB(_LIBICONV_VERSION >= 0x010D)\fP. 45 | .SH "SEE ALSO" 46 | .BR iconv_open (3) 47 | .BR iconv (3) 48 | -------------------------------------------------------------------------------- /man/iconvctl.3: -------------------------------------------------------------------------------- 1 | .\" Copyright (c) Perry Rapp 2 | .\" Copyright (c) Free Software Foundation, Inc. 3 | .\" 4 | .\" This is free documentation; you can redistribute it and/or 5 | .\" modify it under the terms of the GNU General Public License as 6 | .\" published by the Free Software Foundation; either version 3 of 7 | .\" the License, or (at your option) any later version. 8 | .\" 9 | .\" References consulted: 10 | .\" iconv.h 11 | .\" 12 | .TH ICONVCTL 3 "March 31, 2007" "GNU" "Linux Programmer's Manual" 13 | .SH NAME 14 | iconvctl \- control iconv behavior 15 | .SH SYNOPSIS 16 | .nf 17 | .B #include 18 | .sp 19 | .BI "int iconvctl (iconv_t " cd " , int " request ", void * " argument ); 20 | .fi 21 | .SH DESCRIPTION 22 | The argument \fIcd\fP must be a conversion descriptor created using the 23 | function \fBiconv_open\fP. 24 | .PP 25 | \fBiconvctl\fP queries or adjusts the behavior of the \fBiconv\fP function, 26 | when invoked with the specified conversion descriptor, depending on the 27 | request value. 28 | .SH "REQUEST VALUES" 29 | The following are permissible values for the \fIrequest\fP parameter. 30 | .TP 31 | .B ICONV_TRIVIALP 32 | \fIargument\fP should be an \fBint *\fP which will receive 1 if the 33 | conversion is trivial, or 0 otherwise. 34 | .TP 35 | .B ICONV_GET_TRANSLITERATE 36 | \fIargument\fP should be an \fBint *\fP which will receive 1 if 37 | transliteration is enabled in the conversion, or 0 otherwise. 38 | .TP 39 | .B ICONV_SET_TRANSLITERATE 40 | \fIargument\fP should be a \fBconst int *\fP, pointing to an \fBint\fP value. 41 | A non-zero value is used to enable transliteration in the conversion. A zero 42 | value disables it. 43 | .TP 44 | .B ICONV_GET_DISCARD_ILSEQ 45 | \fIargument\fP should be an \fBint *\fP which will receive 1 if 46 | "illegal sequence discard and continue" is enabled in the conversion, 47 | or 0 otherwise. 48 | .TP 49 | .B ICONV_SET_DISCARD_ILSEQ 50 | \fIargument\fP should be a \fBconst int *\fP, pointing to an \fBint\fP value. 51 | A non-zero value is used to enable "illegal sequence discard and continue" 52 | in the conversion. A zero value disables it. 53 | .SH "RETURN VALUE" 54 | The \fBiconvctl\fP function returns 0 if it succeeds. In case of error, it sets 55 | \fBerrno\fP and returns \-1. 56 | .SH ERRORS 57 | The following errors can occur, among others: 58 | .TP 59 | .B EINVAL 60 | The request is invalid. 61 | .SH "CONFORMING TO" 62 | This function is implemented only in GNU libiconv and not in other \fBiconv\fP 63 | implementations. It is not backed by a standard. You can test for its presence 64 | through \fB(_LIBICONV_VERSION >= 0x0108)\fP. 65 | .SH "SEE ALSO" 66 | .BR iconv_open (3) 67 | .BR iconv (3) 68 | -------------------------------------------------------------------------------- /os2/iconv.def: -------------------------------------------------------------------------------- 1 | ; iconv.def (emx+gcc) 2 | LIBRARY ICONV 3 | DESCRIPTION 'OS/2 port of libiconv ' 4 | EXPORTS 5 | libiconv_open @1 6 | libiconv @2 7 | libiconv_close @3 8 | libiconvctl @4 9 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | # Set of available languages. 2 | af bg ca cs da de el eo es et fi fr ga gl hr hu id it ja ko lt nl pl pt_BR rm ro ru sk sl sq sr sv tr uk vi wa zh_CN zh_TW 3 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of files which contain translatable strings. 2 | # Copyright (C) 2002 Free Software Foundation, Inc. 3 | 4 | src/iconv.c 5 | -------------------------------------------------------------------------------- /po/Rules-quot: -------------------------------------------------------------------------------- 1 | # Special Makefile rules for English message catalogs with quotation marks. 2 | # 3 | # Copyright (C) 2001-2017 Free Software Foundation, Inc. 4 | # This file, Rules-quot, and its auxiliary files (listed under 5 | # DISTFILES.common.extra1) are free software; the Free Software Foundation 6 | # gives unlimited permission to use, copy, distribute, and modify them. 7 | 8 | DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot 9 | 10 | .SUFFIXES: .insert-header .po-update-en 11 | 12 | en@quot.po-create: 13 | $(MAKE) en@quot.po-update 14 | en@boldquot.po-create: 15 | $(MAKE) en@boldquot.po-update 16 | 17 | en@quot.po-update: en@quot.po-update-en 18 | en@boldquot.po-update: en@boldquot.po-update-en 19 | 20 | .insert-header.po-update-en: 21 | @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ 22 | if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ 23 | tmpdir=`pwd`; \ 24 | echo "$$lang:"; \ 25 | ll=`echo $$lang | sed -e 's/@.*//'`; \ 26 | LC_ALL=C; export LC_ALL; \ 27 | cd $(srcdir); \ 28 | if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ 29 | | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ 30 | { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ 31 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ 32 | $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ 33 | ;; \ 34 | *) \ 35 | $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ 36 | ;; \ 37 | esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ 38 | ; then \ 39 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 40 | rm -f $$tmpdir/$$lang.new.po; \ 41 | else \ 42 | if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ 43 | :; \ 44 | else \ 45 | echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ 46 | exit 1; \ 47 | fi; \ 48 | fi; \ 49 | else \ 50 | echo "creation of $$lang.po failed!" 1>&2; \ 51 | rm -f $$tmpdir/$$lang.new.po; \ 52 | fi 53 | 54 | en@quot.insert-header: insert-header.sin 55 | sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header 56 | 57 | en@boldquot.insert-header: insert-header.sin 58 | sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header 59 | 60 | mostlyclean: mostlyclean-quot 61 | mostlyclean-quot: 62 | rm -f *.insert-header 63 | -------------------------------------------------------------------------------- /po/af.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/po/af.po -------------------------------------------------------------------------------- /po/boldquot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | s/“/“/g 8 | s/”/”/g 9 | s/‘/‘/g 10 | s/’/’/g 11 | -------------------------------------------------------------------------------- /po/da.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/po/da.po -------------------------------------------------------------------------------- /po/en@boldquot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | # This catalog furthermore displays the text between the quotation marks in 24 | # bold face, assuming the VT100/XTerm escape sequences. 25 | # 26 | -------------------------------------------------------------------------------- /po/en@quot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | -------------------------------------------------------------------------------- /po/et.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/po/et.po -------------------------------------------------------------------------------- /po/insert-header.sin: -------------------------------------------------------------------------------- 1 | # Sed script that inserts the file called HEADER before the header entry. 2 | # 3 | # Copyright (C) 2001 Free Software Foundation, Inc. 4 | # Written by Bruno Haible , 2001. 5 | # This file is free software; the Free Software Foundation gives 6 | # unlimited permission to use, copy, distribute, and modify it. 7 | # 8 | # At each occurrence of a line starting with "msgid ", we execute the following 9 | # commands. At the first occurrence, insert the file. At the following 10 | # occurrences, do nothing. The distinction between the first and the following 11 | # occurrences is achieved by looking at the hold space. 12 | /^msgid /{ 13 | x 14 | # Test if the hold space is empty. 15 | s/m/m/ 16 | ta 17 | # Yes it was empty. First occurrence. Read the file. 18 | r HEADER 19 | # Output the file's contents by reading the next line. But don't lose the 20 | # current line while doing this. 21 | g 22 | N 23 | bb 24 | :a 25 | # The hold space was nonempty. Following occurrences. Do nothing. 26 | x 27 | :b 28 | } 29 | -------------------------------------------------------------------------------- /po/quot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | -------------------------------------------------------------------------------- /po/remove-potcdate.sin: -------------------------------------------------------------------------------- 1 | # Sed script that removes the POT-Creation-Date line in the header entry 2 | # from a POT file. 3 | # 4 | # Copyright (C) 2002 Free Software Foundation, Inc. 5 | # Copying and distribution of this file, with or without modification, 6 | # are permitted in any medium without royalty provided the copyright 7 | # notice and this notice are preserved. This file is offered as-is, 8 | # without any warranty. 9 | # 10 | # The distinction between the first and the following occurrences of the 11 | # pattern is achieved by looking at the hold space. 12 | /^"POT-Creation-Date: .*"$/{ 13 | x 14 | # Test if the hold space is empty. 15 | s/P/P/ 16 | ta 17 | # Yes it was empty. First occurrence. Remove the line. 18 | g 19 | d 20 | bb 21 | :a 22 | # The hold space was nonempty. Following occurrences. Do nothing. 23 | x 24 | :b 25 | } 26 | -------------------------------------------------------------------------------- /src/iconv_no_i18n.c: -------------------------------------------------------------------------------- 1 | #define NO_I18N 2 | #include "iconv.c" 3 | -------------------------------------------------------------------------------- /srclib/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Makefile for the srclib subdirectory of GNU libiconv 2 | ## Copyright (C) 2003-2006, 2009, 2016, 2019 Free Software Foundation, Inc. 3 | ## 4 | ## This program is free software; you can redistribute it and/or modify 5 | ## it under the terms of the GNU General Public License as published by 6 | ## the Free Software Foundation; either version 2, or (at your option) 7 | ## any later version. 8 | ## 9 | ## This program is distributed in the hope that it will be useful, 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ## GNU General Public License for more details. 13 | ## 14 | ## You should have received a copy of the GNU General Public License 15 | ## along with this program; if not, see . 16 | 17 | ## Process this file with automake to produce Makefile.in. 18 | 19 | AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects no-dependencies 20 | EXTRA_DIST = 21 | BUILT_SOURCES = 22 | MOSTLYCLEANFILES = core *.stackdump 23 | MOSTLYCLEANDIRS = 24 | 25 | noinst_LIBRARIES = 26 | 27 | AM_CPPFLAGS = 28 | AM_CFLAGS = 29 | 30 | include Makefile.gnulib 31 | -------------------------------------------------------------------------------- /tests/ARMSCII-8.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0x28 0x0028 2 | 0x29 0x0029 3 | 0x2C 0x002C 4 | 0x2D 0x002D 5 | 0x2E 0x002E 6 | -------------------------------------------------------------------------------- /tests/ASCII.TXT: -------------------------------------------------------------------------------- 1 | 0x00 0x0000 2 | 0x01 0x0001 3 | 0x02 0x0002 4 | 0x03 0x0003 5 | 0x04 0x0004 6 | 0x05 0x0005 7 | 0x06 0x0006 8 | 0x07 0x0007 9 | 0x08 0x0008 10 | 0x09 0x0009 11 | 0x0A 0x000A 12 | 0x0B 0x000B 13 | 0x0C 0x000C 14 | 0x0D 0x000D 15 | 0x0E 0x000E 16 | 0x0F 0x000F 17 | 0x10 0x0010 18 | 0x11 0x0011 19 | 0x12 0x0012 20 | 0x13 0x0013 21 | 0x14 0x0014 22 | 0x15 0x0015 23 | 0x16 0x0016 24 | 0x17 0x0017 25 | 0x18 0x0018 26 | 0x19 0x0019 27 | 0x1A 0x001A 28 | 0x1B 0x001B 29 | 0x1C 0x001C 30 | 0x1D 0x001D 31 | 0x1E 0x001E 32 | 0x1F 0x001F 33 | 0x20 0x0020 34 | 0x21 0x0021 35 | 0x22 0x0022 36 | 0x23 0x0023 37 | 0x24 0x0024 38 | 0x25 0x0025 39 | 0x26 0x0026 40 | 0x27 0x0027 41 | 0x28 0x0028 42 | 0x29 0x0029 43 | 0x2A 0x002A 44 | 0x2B 0x002B 45 | 0x2C 0x002C 46 | 0x2D 0x002D 47 | 0x2E 0x002E 48 | 0x2F 0x002F 49 | 0x30 0x0030 50 | 0x31 0x0031 51 | 0x32 0x0032 52 | 0x33 0x0033 53 | 0x34 0x0034 54 | 0x35 0x0035 55 | 0x36 0x0036 56 | 0x37 0x0037 57 | 0x38 0x0038 58 | 0x39 0x0039 59 | 0x3A 0x003A 60 | 0x3B 0x003B 61 | 0x3C 0x003C 62 | 0x3D 0x003D 63 | 0x3E 0x003E 64 | 0x3F 0x003F 65 | 0x40 0x0040 66 | 0x41 0x0041 67 | 0x42 0x0042 68 | 0x43 0x0043 69 | 0x44 0x0044 70 | 0x45 0x0045 71 | 0x46 0x0046 72 | 0x47 0x0047 73 | 0x48 0x0048 74 | 0x49 0x0049 75 | 0x4A 0x004A 76 | 0x4B 0x004B 77 | 0x4C 0x004C 78 | 0x4D 0x004D 79 | 0x4E 0x004E 80 | 0x4F 0x004F 81 | 0x50 0x0050 82 | 0x51 0x0051 83 | 0x52 0x0052 84 | 0x53 0x0053 85 | 0x54 0x0054 86 | 0x55 0x0055 87 | 0x56 0x0056 88 | 0x57 0x0057 89 | 0x58 0x0058 90 | 0x59 0x0059 91 | 0x5A 0x005A 92 | 0x5B 0x005B 93 | 0x5C 0x005C 94 | 0x5D 0x005D 95 | 0x5E 0x005E 96 | 0x5F 0x005F 97 | 0x60 0x0060 98 | 0x61 0x0061 99 | 0x62 0x0062 100 | 0x63 0x0063 101 | 0x64 0x0064 102 | 0x65 0x0065 103 | 0x66 0x0066 104 | 0x67 0x0067 105 | 0x68 0x0068 106 | 0x69 0x0069 107 | 0x6A 0x006A 108 | 0x6B 0x006B 109 | 0x6C 0x006C 110 | 0x6D 0x006D 111 | 0x6E 0x006E 112 | 0x6F 0x006F 113 | 0x70 0x0070 114 | 0x71 0x0071 115 | 0x72 0x0072 116 | 0x73 0x0073 117 | 0x74 0x0074 118 | 0x75 0x0075 119 | 0x76 0x0076 120 | 0x77 0x0077 121 | 0x78 0x0078 122 | 0x79 0x0079 123 | 0x7A 0x007A 124 | 0x7B 0x007B 125 | 0x7C 0x007C 126 | 0x7D 0x007D 127 | 0x7E 0x007E 128 | 0x7F 0x007F 129 | -------------------------------------------------------------------------------- /tests/BIG5-2003.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0xF9FA 0x2554 2 | 0xF9FB 0x2557 3 | 0xF9FC 0x255A 4 | 0xF9FD 0x255D 5 | -------------------------------------------------------------------------------- /tests/BIG5-HKSCS-1999-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/BIG5-HKSCS-1999-snippet -------------------------------------------------------------------------------- /tests/BIG5-HKSCS-1999.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0xF9E9 0x255E 2 | 0xF9EA 0x256A 3 | 0xF9EB 0x2561 4 | 0xF9F9 0x2550 5 | 0xF9FA 0x256D 6 | 0xF9FB 0x256E 7 | 0xF9FC 0x2570 8 | 0xF9FD 0x256F 9 | -------------------------------------------------------------------------------- /tests/BIG5-HKSCS-2001-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/BIG5-HKSCS-2001-snippet -------------------------------------------------------------------------------- /tests/BIG5-HKSCS-2001.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0xF9E9 0x255E 2 | 0xF9EA 0x256A 3 | 0xF9EB 0x2561 4 | 0xF9F9 0x2550 5 | 0xF9FA 0x256D 6 | 0xF9FB 0x256E 7 | 0xF9FC 0x2570 8 | 0xF9FD 0x256F 9 | -------------------------------------------------------------------------------- /tests/BIG5-HKSCS-2004-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/BIG5-HKSCS-2004-snippet -------------------------------------------------------------------------------- /tests/BIG5-HKSCS-2004.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0xF9E9 0x255E 2 | 0xF9EA 0x256A 3 | 0xF9EB 0x2561 4 | 0xF9F9 0x2550 5 | 0xF9FA 0x256D 6 | 0xF9FB 0x256E 7 | 0xF9FC 0x2570 8 | 0xF9FD 0x256F 9 | -------------------------------------------------------------------------------- /tests/BIG5-HKSCS-2008-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/BIG5-HKSCS-2008-snippet -------------------------------------------------------------------------------- /tests/BIG5-HKSCS-2008.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0xF9E9 0x255E 2 | 0xF9EA 0x256A 3 | 0xF9EB 0x2561 4 | 0xF9F9 0x2550 5 | 0xF9FA 0x256D 6 | 0xF9FB 0x256E 7 | 0xF9FC 0x2570 8 | 0xF9FD 0x256F 9 | -------------------------------------------------------------------------------- /tests/CP1161.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0xA0 0x0E48 2 | 0xDB 0x0E49 3 | 0xDC 0x0E4A 4 | 0xDD 0x0E4B 5 | -------------------------------------------------------------------------------- /tests/CP1163.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0xAF 0x203E 2 | 0xD0 0x00D0 3 | -------------------------------------------------------------------------------- /tests/CP1255-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/CP1255-snippet -------------------------------------------------------------------------------- /tests/CP1255.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0xD6C7 0xFB1F 2 | 0xE0C7 0xFB2E 3 | 0xE0C8 0xFB2F 4 | 0xE0CC 0xFB30 5 | 0xE1CC 0xFB31 6 | 0xE1CF 0xFB4C 7 | 0xE2CC 0xFB32 8 | 0xE3CC 0xFB33 9 | 0xE4CC 0xFB34 10 | 0xE5C9 0xFB4B 11 | 0xE5CC 0xFB35 12 | 0xE6CC 0xFB36 13 | 0xE8CC 0xFB38 14 | 0xE9C4 0xFB1D 15 | 0xE9CC 0xFB39 16 | 0xEACC 0xFB3A 17 | 0xEBCC 0xFB3B 18 | 0xEBCF 0xFB4D 19 | 0xECCC 0xFB3C 20 | 0xEECC 0xFB3E 21 | 0xF0CC 0xFB40 22 | 0xF1CC 0xFB41 23 | 0xF3CC 0xFB43 24 | 0xF4CC 0xFB44 25 | 0xF4CF 0xFB4E 26 | 0xF6CC 0xFB46 27 | 0xF7CC 0xFB47 28 | 0xF8CC 0xFB48 29 | 0xF9CC 0xFB49 30 | 0xF9CCD1 0xFB2C 31 | 0xF9CCD2 0xFB2D 32 | 0xF9D1 0xFB2A 33 | 0xF9D2 0xFB2B 34 | 0xFACC 0xFB4A 35 | -------------------------------------------------------------------------------- /tests/CP1258-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/CP1258-snippet -------------------------------------------------------------------------------- /tests/CP950.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0xA244 0x00A5 2 | 0xA2CC 0x5341 3 | 0xA2CE 0x5345 4 | 0xF9E9 0x255E 5 | 0xF9EA 0x256A 6 | 0xF9EB 0x2561 7 | 0xF9F9 0x2550 8 | 0xF9FA 0x256D 9 | 0xF9FB 0x256E 10 | 0xF9FC 0x2570 11 | 0xF9FD 0x256F 12 | -------------------------------------------------------------------------------- /tests/DEC-HANYU.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0xC2CBA1B8 0x5344 2 | -------------------------------------------------------------------------------- /tests/EUC-JP.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0x5C 0x00A5 2 | 0x7E 0x203E 3 | -------------------------------------------------------------------------------- /tests/GB18030.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0x82359037 0x9FB4 2 | 0x82359038 0x9FB5 3 | 0x82359039 0x9FB6 4 | 0x82359130 0x9FB7 5 | 0x82359131 0x9FB8 6 | 0x82359132 0x9FB9 7 | 0x82359133 0x9FBA 8 | 0x82359134 0x9FBB 9 | 0x84318236 0xFE10 10 | 0x84318237 0xFE11 11 | 0x84318238 0xFE12 12 | 0x84318239 0xFE13 13 | 0x84318330 0xFE14 14 | 0x84318331 0xFE15 15 | 0x84318332 0xFE16 16 | 0x84318333 0xFE17 17 | 0x84318334 0xFE18 18 | 0x84318335 0xFE19 19 | 0x95329031 0x20087 20 | 0x95329033 0x20089 21 | 0x95329730 0x200CC 22 | 0x9536B937 0x215D7 23 | 0x9630BA35 0x2298F 24 | 0x9635B630 0x241FE 25 | 0xA6D9 0xE78D 26 | 0xA6DA 0xE78E 27 | 0xA6DB 0xE78F 28 | 0xA6DC 0xE790 29 | 0xA6DD 0xE791 30 | 0xA6DE 0xE792 31 | 0xA6DF 0xE793 32 | 0xA6EC 0xE794 33 | 0xA6ED 0xE795 34 | 0xA6F3 0xE796 35 | 0xFE51 0xE816 36 | 0xFE52 0xE817 37 | 0xFE53 0xE818 38 | 0xFE59 0xE81E 39 | 0xFE61 0xE826 40 | 0xFE66 0xE82B 41 | 0xFE67 0xE82C 42 | 0xFE6C 0xE831 43 | 0xFE6D 0xE832 44 | 0xFE76 0xE83B 45 | 0xFE7E 0xE843 46 | 0xFE90 0xE854 47 | 0xFE91 0xE855 48 | 0xFEA0 0xE864 49 | -------------------------------------------------------------------------------- /tests/HZ-snippet: -------------------------------------------------------------------------------- 1 | Chinese (~{VPND~},~{FUM(;0~},~{::So~}) ~{Dc:C~} 2 | GB -- ~{T*Fx~} ~{?*7"~} 3 | -------------------------------------------------------------------------------- /tests/HZ-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | Chinese (中文,普通话,汉语) 你好 2 | GB -- 元气 开发 3 | -------------------------------------------------------------------------------- /tests/IBM-1160.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0x51 0x0E48 2 | 0xCA 0x0E49 3 | 0xE1 0x0E4A 4 | 0xFD 0x0E4B 5 | -------------------------------------------------------------------------------- /tests/IBM-838.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0x51 0x0E48 2 | 0xCA 0x0E49 3 | 0xE1 0x0E4A 4 | 0xFD 0x0E4B 5 | 0xFE 0x0E4C 6 | -------------------------------------------------------------------------------- /tests/ISO-2022-CN-EXT-snippet: -------------------------------------------------------------------------------- 1 | Chinese ($)AVPND,FUM(;0,::So) Dc:C 2 | GB -- $)AT*Fx ?*7" 3 | $)G^O$+IO7J$*HN+j 4 | -------------------------------------------------------------------------------- /tests/ISO-2022-CN-EXT-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | Chinese (中文,普通话,汉语) 你好 2 | GB -- 元气 开发 3 | 喲痓洈 4 | -------------------------------------------------------------------------------- /tests/ISO-2022-CN-snippet: -------------------------------------------------------------------------------- 1 | Chinese ($)AVPND,FUM(;0,::So) Dc:C 2 | GB -- $)AT*Fx ?*7" 3 | $)G^O$*HN+j 4 | -------------------------------------------------------------------------------- /tests/ISO-2022-CN-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | Chinese (中文,普通话,汉语) 你好 2 | GB -- 元气 开发 3 | 喲洈 4 | -------------------------------------------------------------------------------- /tests/ISO-2022-JP-1-snippet: -------------------------------------------------------------------------------- 1 | Just for a test of JISX0212: $BqV$(DiQ(B (the second character is of JISX0212) 2 | -------------------------------------------------------------------------------- /tests/ISO-2022-JP-1-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | Just for a test of JISX0212: 騏驎 (the second character is of JISX0212) 2 | -------------------------------------------------------------------------------- /tests/ISO-2022-JP-2-snippet: -------------------------------------------------------------------------------- 1 | Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B, (I:]FAJ(B 2 | JIS -- $B855$(B $B3+H/(B 3 | Just for a test of JISX0212: $BqV$(DiQ(B (the second character is of JISX0212) 4 | Chinese ($BCfJ8(B,$BIaDL$A;0(B,$A::So(B) $(D0_$B9%(B 5 | GB -- $B85]c(B $A?*7"(B 6 | Korean ($(CGQ1[(B) $(C>H3gGO<H3gGO=J4O1n(B 7 | KSC -- $B85]f(B $B3+b$(B 8 | -------------------------------------------------------------------------------- /tests/ISO-2022-JP-2-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | Japanese (日本語) こんにちは, コンニチハ 2 | JIS -- 元気 開発 3 | Just for a test of JISX0212: 騏驎 (the second character is of JISX0212) 4 | Chinese (中文,普通话,汉语) 你好 5 | GB -- 元气 开发 6 | Korean (한글) 안녕하세요, 안녕하십니까 7 | KSC -- 元氣 開發 8 | -------------------------------------------------------------------------------- /tests/ISO-2022-JP-snippet: -------------------------------------------------------------------------------- 1 | Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B 2 | JIS -- $B855$(B $B3+H/(B 3 | -------------------------------------------------------------------------------- /tests/ISO-2022-JP-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | Japanese (日本語) こんにちは 2 | JIS -- 元気 開発 3 | -------------------------------------------------------------------------------- /tests/ISO-2022-KR-snippet: -------------------------------------------------------------------------------- 1 | Korean ($)CGQ1[) >H3gGO<H3gGO=J4O1n 2 | KSC -- $)Cj*Q( KR[! 3 | -------------------------------------------------------------------------------- /tests/ISO-2022-KR-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | Korean (한글) 안녕하세요, 안녕하십니까 2 | KSC -- 元氣 開發 3 | -------------------------------------------------------------------------------- /tests/ISO-IR-165.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0x2821 0x1FB1 2 | 0x2822 0x03AC 3 | 0x2823 0x1FB0 4 | 0x2824 0x1F70 5 | 0x2825 0x0113 6 | 0x2826 0x00E9 7 | 0x2827 0x011B 8 | 0x2828 0x00E8 9 | 0x2829 0x012B 10 | 0x282A 0x00ED 11 | 0x282B 0x01D0 12 | 0x282C 0x00EC 13 | 0x282D 0x014D 14 | 0x282E 0x00F3 15 | 0x282F 0x01D2 16 | 0x2830 0x00F2 17 | 0x2831 0x016B 18 | 0x2832 0x00FA 19 | 0x2833 0x01D4 20 | 0x2834 0x00F9 21 | 0x2835 0x01D6 22 | 0x2836 0x01D8 23 | 0x2837 0x01DA 24 | 0x2838 0x01DC 25 | 0x2839 0x00FC 26 | 0x283A 0x00EA 27 | 0x283B 0x03B1 28 | 0x283C 0x1E3F 29 | 0x283D 0x0144 30 | 0x283E 0x0148 31 | 0x283F 0x01F9 32 | 0x2840 0xFF47 33 | 0x2B3B 0x03B1 34 | 0x2B40 0xFF47 35 | -------------------------------------------------------------------------------- /tests/ISO646-CN.TXT: -------------------------------------------------------------------------------- 1 | 0x00 0x0000 2 | 0x01 0x0001 3 | 0x02 0x0002 4 | 0x03 0x0003 5 | 0x04 0x0004 6 | 0x05 0x0005 7 | 0x06 0x0006 8 | 0x07 0x0007 9 | 0x08 0x0008 10 | 0x09 0x0009 11 | 0x0A 0x000A 12 | 0x0B 0x000B 13 | 0x0C 0x000C 14 | 0x0D 0x000D 15 | 0x0E 0x000E 16 | 0x0F 0x000F 17 | 0x10 0x0010 18 | 0x11 0x0011 19 | 0x12 0x0012 20 | 0x13 0x0013 21 | 0x14 0x0014 22 | 0x15 0x0015 23 | 0x16 0x0016 24 | 0x17 0x0017 25 | 0x18 0x0018 26 | 0x19 0x0019 27 | 0x1A 0x001A 28 | 0x1B 0x001B 29 | 0x1C 0x001C 30 | 0x1D 0x001D 31 | 0x1E 0x001E 32 | 0x1F 0x001F 33 | 0x20 0x0020 34 | 0x21 0x0021 35 | 0x22 0x0022 36 | 0x23 0x0023 37 | 0x24 0x00A5 38 | 0x25 0x0025 39 | 0x26 0x0026 40 | 0x27 0x0027 41 | 0x28 0x0028 42 | 0x29 0x0029 43 | 0x2A 0x002A 44 | 0x2B 0x002B 45 | 0x2C 0x002C 46 | 0x2D 0x002D 47 | 0x2E 0x002E 48 | 0x2F 0x002F 49 | 0x30 0x0030 50 | 0x31 0x0031 51 | 0x32 0x0032 52 | 0x33 0x0033 53 | 0x34 0x0034 54 | 0x35 0x0035 55 | 0x36 0x0036 56 | 0x37 0x0037 57 | 0x38 0x0038 58 | 0x39 0x0039 59 | 0x3A 0x003A 60 | 0x3B 0x003B 61 | 0x3C 0x003C 62 | 0x3D 0x003D 63 | 0x3E 0x003E 64 | 0x3F 0x003F 65 | 0x40 0x0040 66 | 0x41 0x0041 67 | 0x42 0x0042 68 | 0x43 0x0043 69 | 0x44 0x0044 70 | 0x45 0x0045 71 | 0x46 0x0046 72 | 0x47 0x0047 73 | 0x48 0x0048 74 | 0x49 0x0049 75 | 0x4A 0x004A 76 | 0x4B 0x004B 77 | 0x4C 0x004C 78 | 0x4D 0x004D 79 | 0x4E 0x004E 80 | 0x4F 0x004F 81 | 0x50 0x0050 82 | 0x51 0x0051 83 | 0x52 0x0052 84 | 0x53 0x0053 85 | 0x54 0x0054 86 | 0x55 0x0055 87 | 0x56 0x0056 88 | 0x57 0x0057 89 | 0x58 0x0058 90 | 0x59 0x0059 91 | 0x5A 0x005A 92 | 0x5B 0x005B 93 | 0x5C 0x005C 94 | 0x5D 0x005D 95 | 0x5E 0x005E 96 | 0x5F 0x005F 97 | 0x60 0x0060 98 | 0x61 0x0061 99 | 0x62 0x0062 100 | 0x63 0x0063 101 | 0x64 0x0064 102 | 0x65 0x0065 103 | 0x66 0x0066 104 | 0x67 0x0067 105 | 0x68 0x0068 106 | 0x69 0x0069 107 | 0x6A 0x006A 108 | 0x6B 0x006B 109 | 0x6C 0x006C 110 | 0x6D 0x006D 111 | 0x6E 0x006E 112 | 0x6F 0x006F 113 | 0x70 0x0070 114 | 0x71 0x0071 115 | 0x72 0x0072 116 | 0x73 0x0073 117 | 0x74 0x0074 118 | 0x75 0x0075 119 | 0x76 0x0076 120 | 0x77 0x0077 121 | 0x78 0x0078 122 | 0x79 0x0079 123 | 0x7A 0x007A 124 | 0x7B 0x007B 125 | 0x7C 0x007C 126 | 0x7D 0x007D 127 | 0x7E 0x203E 128 | 0x7F 0x007F 129 | -------------------------------------------------------------------------------- /tests/ISO646-JP.TXT: -------------------------------------------------------------------------------- 1 | 0x00 0x0000 2 | 0x01 0x0001 3 | 0x02 0x0002 4 | 0x03 0x0003 5 | 0x04 0x0004 6 | 0x05 0x0005 7 | 0x06 0x0006 8 | 0x07 0x0007 9 | 0x08 0x0008 10 | 0x09 0x0009 11 | 0x0A 0x000A 12 | 0x0B 0x000B 13 | 0x0C 0x000C 14 | 0x0D 0x000D 15 | 0x0E 0x000E 16 | 0x0F 0x000F 17 | 0x10 0x0010 18 | 0x11 0x0011 19 | 0x12 0x0012 20 | 0x13 0x0013 21 | 0x14 0x0014 22 | 0x15 0x0015 23 | 0x16 0x0016 24 | 0x17 0x0017 25 | 0x18 0x0018 26 | 0x19 0x0019 27 | 0x1A 0x001A 28 | 0x1B 0x001B 29 | 0x1C 0x001C 30 | 0x1D 0x001D 31 | 0x1E 0x001E 32 | 0x1F 0x001F 33 | 0x20 0x0020 34 | 0x21 0x0021 35 | 0x22 0x0022 36 | 0x23 0x0023 37 | 0x24 0x0024 38 | 0x25 0x0025 39 | 0x26 0x0026 40 | 0x27 0x0027 41 | 0x28 0x0028 42 | 0x29 0x0029 43 | 0x2A 0x002A 44 | 0x2B 0x002B 45 | 0x2C 0x002C 46 | 0x2D 0x002D 47 | 0x2E 0x002E 48 | 0x2F 0x002F 49 | 0x30 0x0030 50 | 0x31 0x0031 51 | 0x32 0x0032 52 | 0x33 0x0033 53 | 0x34 0x0034 54 | 0x35 0x0035 55 | 0x36 0x0036 56 | 0x37 0x0037 57 | 0x38 0x0038 58 | 0x39 0x0039 59 | 0x3A 0x003A 60 | 0x3B 0x003B 61 | 0x3C 0x003C 62 | 0x3D 0x003D 63 | 0x3E 0x003E 64 | 0x3F 0x003F 65 | 0x40 0x0040 66 | 0x41 0x0041 67 | 0x42 0x0042 68 | 0x43 0x0043 69 | 0x44 0x0044 70 | 0x45 0x0045 71 | 0x46 0x0046 72 | 0x47 0x0047 73 | 0x48 0x0048 74 | 0x49 0x0049 75 | 0x4A 0x004A 76 | 0x4B 0x004B 77 | 0x4C 0x004C 78 | 0x4D 0x004D 79 | 0x4E 0x004E 80 | 0x4F 0x004F 81 | 0x50 0x0050 82 | 0x51 0x0051 83 | 0x52 0x0052 84 | 0x53 0x0053 85 | 0x54 0x0054 86 | 0x55 0x0055 87 | 0x56 0x0056 88 | 0x57 0x0057 89 | 0x58 0x0058 90 | 0x59 0x0059 91 | 0x5A 0x005A 92 | 0x5B 0x005B 93 | 0x5C 0x00A5 94 | 0x5D 0x005D 95 | 0x5E 0x005E 96 | 0x5F 0x005F 97 | 0x60 0x0060 98 | 0x61 0x0061 99 | 0x62 0x0062 100 | 0x63 0x0063 101 | 0x64 0x0064 102 | 0x65 0x0065 103 | 0x66 0x0066 104 | 0x67 0x0067 105 | 0x68 0x0068 106 | 0x69 0x0069 107 | 0x6A 0x006A 108 | 0x6B 0x006B 109 | 0x6C 0x006C 110 | 0x6D 0x006D 111 | 0x6E 0x006E 112 | 0x6F 0x006F 113 | 0x70 0x0070 114 | 0x71 0x0071 115 | 0x72 0x0072 116 | 0x73 0x0073 117 | 0x74 0x0074 118 | 0x75 0x0075 119 | 0x76 0x0076 120 | 0x77 0x0077 121 | 0x78 0x0078 122 | 0x79 0x0079 123 | 0x7A 0x007A 124 | 0x7B 0x007B 125 | 0x7C 0x007C 126 | 0x7D 0x007D 127 | 0x7E 0x203E 128 | 0x7F 0x007F 129 | -------------------------------------------------------------------------------- /tests/Quotes.ASCII: -------------------------------------------------------------------------------- 1 | "Hello" 2 | 'Hello' 3 | "Hello" 4 | 'Hello' 5 | -------------------------------------------------------------------------------- /tests/Quotes.ISO-8859-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/Quotes.ISO-8859-1 -------------------------------------------------------------------------------- /tests/Quotes.UTF-8: -------------------------------------------------------------------------------- 1 | “Hello” 2 | ‘Hello’ 3 | „Hello” 4 | ‚Hello’ 5 | -------------------------------------------------------------------------------- /tests/TCVN-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/TCVN-snippet -------------------------------------------------------------------------------- /tests/TCVN.IRREVERSIBLE.TXT: -------------------------------------------------------------------------------- 1 | 0x01B2 0x1E78 2 | 0x20B2 0x02DC 3 | 0x20B3 0x00B4 4 | 0x42B4 0x1E04 5 | 0x43B3 0x0106 6 | 0x44B4 0x1E0C 7 | 0x47B3 0x01F4 8 | 0x48B4 0x1E24 9 | 0x4BB3 0x1E30 10 | 0x4BB4 0x1E32 11 | 0x4CB3 0x0139 12 | 0x4CB4 0x1E36 13 | 0x4DB3 0x1E3E 14 | 0x4DB4 0x1E42 15 | 0x4EB0 0x01F8 16 | 0x4EB2 0x00D1 17 | 0x4EB3 0x0143 18 | 0x4EB4 0x1E46 19 | 0x50B3 0x1E54 20 | 0x52B3 0x0154 21 | 0x52B4 0x1E5A 22 | 0x53B3 0x015A 23 | 0x53B4 0x1E62 24 | 0x54B4 0x1E6C 25 | 0x56B2 0x1E7C 26 | 0x56B4 0x1E7E 27 | 0x57B0 0x1E80 28 | 0x57B3 0x1E82 29 | 0x57B4 0x1E88 30 | 0x5AB3 0x0179 31 | 0x5AB4 0x1E92 32 | 0x62B4 0x1E05 33 | 0x63B3 0x0107 34 | 0x64B4 0x1E0D 35 | 0x67B3 0x01F5 36 | 0x68B4 0x1E25 37 | 0x6BB3 0x1E31 38 | 0x6BB4 0x1E33 39 | 0x6CB3 0x013A 40 | 0x6CB4 0x1E37 41 | 0x6DB3 0x1E3F 42 | 0x6DB4 0x1E43 43 | 0x6EB0 0x01F9 44 | 0x6EB2 0x00F1 45 | 0x6EB3 0x0144 46 | 0x6EB4 0x1E47 47 | 0x70B3 0x1E55 48 | 0x72B3 0x0155 49 | 0x72B4 0x1E5B 50 | 0x73B3 0x015B 51 | 0x73B4 0x1E63 52 | 0x74B4 0x1E6D 53 | 0x76B2 0x1E7D 54 | 0x76B4 0x1E7F 55 | 0x77B0 0x1E81 56 | 0x77B3 0x1E83 57 | 0x77B4 0x1E89 58 | 0x7AB3 0x017A 59 | 0x7AB4 0x1E93 60 | 0x95B2 0x1E4C 61 | 0xB0 0x0340 62 | 0xB3 0x0341 63 | 0xE3B2 0x1E4D 64 | 0xF3B2 0x1E79 65 | -------------------------------------------------------------------------------- /tests/TDS565.TXT: -------------------------------------------------------------------------------- 1 | 0x00 0x0000 2 | 0x01 0x0001 3 | 0x02 0x0002 4 | 0x03 0x0003 5 | 0x04 0x0004 6 | 0x05 0x0005 7 | 0x06 0x0006 8 | 0x07 0x0007 9 | 0x08 0x0008 10 | 0x09 0x0009 11 | 0x0A 0x000A 12 | 0x0B 0x000B 13 | 0x0C 0x000C 14 | 0x0D 0x000D 15 | 0x0E 0x000E 16 | 0x0F 0x000F 17 | 0x10 0x0010 18 | 0x11 0x0011 19 | 0x12 0x0012 20 | 0x13 0x0013 21 | 0x14 0x0014 22 | 0x15 0x0015 23 | 0x16 0x0016 24 | 0x17 0x0017 25 | 0x18 0x0018 26 | 0x19 0x0019 27 | 0x1A 0x001A 28 | 0x1B 0x001B 29 | 0x1C 0x001C 30 | 0x1D 0x001D 31 | 0x1E 0x001E 32 | 0x1F 0x001F 33 | 0x20 0x0020 34 | 0x21 0x0021 35 | 0x22 0x0022 36 | 0x23 0x0023 37 | 0x24 0x0024 38 | 0x25 0x0025 39 | 0x26 0x0026 40 | 0x27 0x0027 41 | 0x28 0x0028 42 | 0x29 0x0029 43 | 0x2A 0x002A 44 | 0x2B 0x002B 45 | 0x2C 0x002C 46 | 0x2D 0x002D 47 | 0x2E 0x002E 48 | 0x2F 0x002F 49 | 0x30 0x0030 50 | 0x31 0x0031 51 | 0x32 0x0032 52 | 0x33 0x0033 53 | 0x34 0x0034 54 | 0x35 0x0035 55 | 0x36 0x0036 56 | 0x37 0x0037 57 | 0x38 0x0038 58 | 0x39 0x0039 59 | 0x3A 0x003A 60 | 0x3B 0x003B 61 | 0x3C 0x003C 62 | 0x3D 0x003D 63 | 0x3E 0x003E 64 | 0x3F 0x003F 65 | 0x40 0x0040 66 | 0x41 0x0041 67 | 0x42 0x0042 68 | 0x43 0x00C7 69 | 0x44 0x0044 70 | 0x45 0x0045 71 | 0x46 0x00C4 72 | 0x47 0x0046 73 | 0x48 0x0047 74 | 0x49 0x0048 75 | 0x4A 0x0049 76 | 0x4B 0x004A 77 | 0x4C 0x017D 78 | 0x4D 0x004B 79 | 0x4E 0x004C 80 | 0x4F 0x004D 81 | 0x50 0x004E 82 | 0x51 0x0147 83 | 0x52 0x004F 84 | 0x53 0x00D6 85 | 0x54 0x0050 86 | 0x55 0x0052 87 | 0x56 0x0053 88 | 0x57 0x015E 89 | 0x58 0x0054 90 | 0x59 0x0055 91 | 0x5A 0x00DC 92 | 0x5B 0x0057 93 | 0x5C 0x0059 94 | 0x5D 0x00DD 95 | 0x5E 0x005A 96 | 0x5F 0x005F 97 | 0x60 0x2116 98 | 0x61 0x0061 99 | 0x62 0x0062 100 | 0x63 0x00E7 101 | 0x64 0x0064 102 | 0x65 0x0065 103 | 0x66 0x00E4 104 | 0x67 0x0066 105 | 0x68 0x0067 106 | 0x69 0x0068 107 | 0x6A 0x0069 108 | 0x6B 0x006A 109 | 0x6C 0x017E 110 | 0x6D 0x006B 111 | 0x6E 0x006C 112 | 0x6F 0x006D 113 | 0x70 0x006E 114 | 0x71 0x0148 115 | 0x72 0x006F 116 | 0x73 0x00F6 117 | 0x74 0x0070 118 | 0x75 0x0072 119 | 0x76 0x0073 120 | 0x77 0x015F 121 | 0x78 0x0074 122 | 0x79 0x0075 123 | 0x7A 0x00FC 124 | 0x7B 0x0077 125 | 0x7C 0x0079 126 | 0x7D 0x00FD 127 | 0x7E 0x007A 128 | 0x7F 0x007F 129 | -------------------------------------------------------------------------------- /tests/Translit1.ASCII: -------------------------------------------------------------------------------- 1 | 'Ecrit par %s. 2 | -------------------------------------------------------------------------------- /tests/Translit1.ISO-8859-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/Translit1.ISO-8859-1 -------------------------------------------------------------------------------- /tests/TranslitFail1.ISO-8859-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/TranslitFail1.ISO-8859-1 -------------------------------------------------------------------------------- /tests/UCS-2BE-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/UCS-2BE-snippet -------------------------------------------------------------------------------- /tests/UCS-2BE-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | This is a list of ways to say hello in various languages. 2 | Its purpose is to illustrate a number of scripts. 3 | 4 | --------------------------------------------------------- 5 | Amharic (አማርኛ) ሠላም 6 | Arabic ﺍﻟﺴﻼﻡ ﻋﻠﻴﻜﻢ 7 | Czech (česky) Dobrý den 8 | Danish (Dansk) Hej, Goddag 9 | English Hello 10 | Esperanto Saluton 11 | Estonian Tere, Tervist 12 | FORTRAN PROGRAM 13 | Finnish (Suomi) Hei 14 | French (Français) Bonjour, Salut 15 | German (Deutsch Nord) Guten Tag 16 | German (Deutsch Süd) Grüß Gott 17 | Greek (Ελληνικά) Γειά σας 18 | Hebrew שלום 19 | Italiano Ciao, Buon giorno 20 | Lao(ພາສາລາວ) ສະບາຍດີ, ຂໍໃຫ້ໂຊກດີ 21 | Maltese Ciao 22 | Nederlands, Vlaams Hallo, Dag 23 | Norwegian (Norsk) Hei, God dag 24 | Polish Dzień dobry, Hej 25 | Russian (Русский) Здравствуйте! 26 | Slovak Dobrý deň 27 | Spanish (Español) ¡Hola! 28 | Swedish (Svenska) Hej, Goddag 29 | Thai (ภาษาไทย) สวัสดีครับ, สวัสดีค่ะ 30 | 31 | Tigrigna (ትግርኛ) ሰላማት 32 | Turkish (Türkçe) Merhaba 33 | Vietnamese (Tiếng Việt) Chào bạn 34 | 35 | Japanese (日本語) こんにちは, コンニチハ 36 | Chinese (中文,普通话,汉语) 你好 37 | Cantonese (粵語,廣東話) 早晨, 你好 38 | Korean (한글) 안녕하세요, 안녕하십니까 39 | 40 | Difference among chinese characters in GB, JIS, KSC, BIG5: 41 | GB -- 元气 开发 42 | JIS -- 元気 開発 43 | KSC -- 元氣 開發 44 | BIG5 -- 元氣 開發 45 | 46 | Just for a test of JISX0212: 騏驎 (the second character is of JISX0212) 47 | -------------------------------------------------------------------------------- /tests/UCS-2LE-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/UCS-2LE-snippet -------------------------------------------------------------------------------- /tests/UCS-2LE-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | This is a list of ways to say hello in various languages. 2 | Its purpose is to illustrate a number of scripts. 3 | 4 | --------------------------------------------------------- 5 | Amharic (አማርኛ) ሠላም 6 | Arabic ﺍﻟﺴﻼﻡ ﻋﻠﻴﻜﻢ 7 | Czech (česky) Dobrý den 8 | Danish (Dansk) Hej, Goddag 9 | English Hello 10 | Esperanto Saluton 11 | Estonian Tere, Tervist 12 | FORTRAN PROGRAM 13 | Finnish (Suomi) Hei 14 | French (Français) Bonjour, Salut 15 | German (Deutsch Nord) Guten Tag 16 | German (Deutsch Süd) Grüß Gott 17 | Greek (Ελληνικά) Γειά σας 18 | Hebrew שלום 19 | Italiano Ciao, Buon giorno 20 | Lao(ພາສາລາວ) ສະບາຍດີ, ຂໍໃຫ້ໂຊກດີ 21 | Maltese Ciao 22 | Nederlands, Vlaams Hallo, Dag 23 | Norwegian (Norsk) Hei, God dag 24 | Polish Dzień dobry, Hej 25 | Russian (Русский) Здравствуйте! 26 | Slovak Dobrý deň 27 | Spanish (Español) ¡Hola! 28 | Swedish (Svenska) Hej, Goddag 29 | Thai (ภาษาไทย) สวัสดีครับ, สวัสดีค่ะ 30 | 31 | Tigrigna (ትግርኛ) ሰላማት 32 | Turkish (Türkçe) Merhaba 33 | Vietnamese (Tiếng Việt) Chào bạn 34 | 35 | Japanese (日本語) こんにちは, コンニチハ 36 | Chinese (中文,普通话,汉语) 你好 37 | Cantonese (粵語,廣東話) 早晨, 你好 38 | Korean (한글) 안녕하세요, 안녕하십니까 39 | 40 | Difference among chinese characters in GB, JIS, KSC, BIG5: 41 | GB -- 元气 开发 42 | JIS -- 元気 開発 43 | KSC -- 元氣 開發 44 | BIG5 -- 元氣 開發 45 | 46 | Just for a test of JISX0212: 騏驎 (the second character is of JISX0212) 47 | -------------------------------------------------------------------------------- /tests/UCS-4BE-snippet: -------------------------------------------------------------------------------- 1 | #E=Ra -------------------------------------------------------------------------------- /tests/UCS-4BE-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | 𒍅=Ra -------------------------------------------------------------------------------- /tests/UCS-4LE-snippet: -------------------------------------------------------------------------------- 1 | E#=Ra -------------------------------------------------------------------------------- /tests/UCS-4LE-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | 𒍅=Ra -------------------------------------------------------------------------------- /tests/UTF-16-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/UTF-16-snippet -------------------------------------------------------------------------------- /tests/UTF-16-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | 𒍅=Ra -------------------------------------------------------------------------------- /tests/UTF-16BE-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/UTF-16BE-snippet -------------------------------------------------------------------------------- /tests/UTF-16BE-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | 𒍅=Ra -------------------------------------------------------------------------------- /tests/UTF-16LE-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/UTF-16LE-snippet -------------------------------------------------------------------------------- /tests/UTF-16LE-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | 𒍅=Ra -------------------------------------------------------------------------------- /tests/UTF-32-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/UTF-32-snippet -------------------------------------------------------------------------------- /tests/UTF-32-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ <- Greek 2 | 𐌀𐌁𐌂𐌃𐌄𐌅𐌆𐌇𐌈𐌉𐌊𐌋𐌌𐌍𐌎𐌏𐌐𐌑𐌒𐌓𐌔𐌕𐌖𐌗𐌘𐌙𐌚𐌛𐌜𐌝 <- Etruscan 3 | ABCDEFGHIJKLMNOPQRSTUVWXYZ <- Latin 4 | АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ <- Cyrillic 5 | 𐌰𐌱𐌲𐌳𐌴𐌵𐌶𐌷𐌸𐌹𐌺𐌻𐌼𐌽𐌾𐌿𐍀𐍁𐍂𐍃𐍄𐍅𐍆𐍇𐍈 <- Gothic 6 | אבגדהוזחטיךכלםמןנסעףפץצקרש <- Hebrew 7 | -------------------------------------------------------------------------------- /tests/UTF-32BE-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/UTF-32BE-snippet -------------------------------------------------------------------------------- /tests/UTF-32BE-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ <- Greek 2 | 𐌀𐌁𐌂𐌃𐌄𐌅𐌆𐌇𐌈𐌉𐌊𐌋𐌌𐌍𐌎𐌏𐌐𐌑𐌒𐌓𐌔𐌕𐌖𐌗𐌘𐌙𐌚𐌛𐌜𐌝 <- Etruscan 3 | ABCDEFGHIJKLMNOPQRSTUVWXYZ <- Latin 4 | АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ <- Cyrillic 5 | 𐌰𐌱𐌲𐌳𐌴𐌵𐌶𐌷𐌸𐌹𐌺𐌻𐌼𐌽𐌾𐌿𐍀𐍁𐍂𐍃𐍄𐍅𐍆𐍇𐍈 <- Gothic 6 | אבגדהוזחטיךכלםמןנסעףפץצקרש <- Hebrew 7 | -------------------------------------------------------------------------------- /tests/UTF-32LE-snippet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiftMediaProject/libiconv/668b36a89281e8361fe490634d17a912156ce7fd/tests/UTF-32LE-snippet -------------------------------------------------------------------------------- /tests/UTF-32LE-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ <- Greek 2 | 𐌀𐌁𐌂𐌃𐌄𐌅𐌆𐌇𐌈𐌉𐌊𐌋𐌌𐌍𐌎𐌏𐌐𐌑𐌒𐌓𐌔𐌕𐌖𐌗𐌘𐌙𐌚𐌛𐌜𐌝 <- Etruscan 3 | ABCDEFGHIJKLMNOPQRSTUVWXYZ <- Latin 4 | АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ <- Cyrillic 5 | 𐌰𐌱𐌲𐌳𐌴𐌵𐌶𐌷𐌸𐌹𐌺𐌻𐌼𐌽𐌾𐌿𐍀𐍁𐍂𐍃𐍄𐍅𐍆𐍇𐍈 <- Gothic 6 | אבגדהוזחטיךכלםמןנסעףפץצקרש <- Hebrew 7 | -------------------------------------------------------------------------------- /tests/UTF-7-snippet: -------------------------------------------------------------------------------- 1 | A+ImIDkQ- -------------------------------------------------------------------------------- /tests/UTF-7-snippet.UTF-8: -------------------------------------------------------------------------------- 1 | A≢Α -------------------------------------------------------------------------------- /tests/check-stateful: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Simple check of a stateful encoding. 3 | # Usage: check-stateful SRCDIR CHARSET 4 | srcdir="$1" 5 | charset="$2" 6 | set -e 7 | 8 | # charset, modified for use in filenames. 9 | charsetf=`echo "$charset" | sed -e 's,:,-,g'` 10 | 11 | if test -f "${srcdir}"/"$charsetf"-snippet.alt; then 12 | ../src/iconv_no_i18n -f "$charset" -t UTF-8 < "${srcdir}"/"$charsetf"-snippet.alt > tmp-snippet 13 | cmp "${srcdir}"/"$charsetf"-snippet.UTF-8 tmp-snippet 14 | fi 15 | ../src/iconv_no_i18n -f "$charset" -t UTF-8 < "${srcdir}"/"$charsetf"-snippet > tmp-snippet 16 | cmp "${srcdir}"/"$charsetf"-snippet.UTF-8 tmp-snippet 17 | ../src/iconv_no_i18n -f UTF-8 -t "$charset" < "${srcdir}"/"$charsetf"-snippet.UTF-8 > tmp-snippet 18 | cmp "${srcdir}"/"$charsetf"-snippet tmp-snippet 19 | rm -f tmp-snippet 20 | exit 0 21 | -------------------------------------------------------------------------------- /tests/check-stateful.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | REM Simple check of a stateful encoding. 3 | REM Usage: check-stateful.bat SRCDIR CHARSET 4 | 5 | if not exist %1\%2-snippet.alt goto ENDIF_1 6 | ..\src\iconv_no_i18n -f %2 -t UTF-8 < %1\%2-snippet.alt > tmp-snippet 7 | fc %1\%2-snippet.UTF-8 tmp-snippet 8 | :ENDIF_1 9 | 10 | ..\src\iconv_no_i18n -f %2 -t UTF-8 < %1\%2-snippet > tmp-snippet 11 | fc %1\%2-snippet.UTF-8 tmp-snippet 12 | ..\src\iconv_no_i18n -f UTF-8 -t %2 < %1\%2-snippet.UTF-8 > tmp-snippet 13 | fc %1\%2-snippet tmp-snippet 14 | del tmp-snippet 15 | -------------------------------------------------------------------------------- /tests/check-stateless: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Complete check of a stateless encoding. 3 | # Usage: check-stateless SRCDIR CHARSET 4 | srcdir="$1" 5 | charset="$2" 6 | set -e 7 | 8 | # charset, modified for use in filenames. 9 | charsetf=`echo "$charset" | sed -e 's,:,-,g'` 10 | 11 | # iconv in one direction. 12 | ./table-from "$charset" > tmp-"$charsetf".TXT 13 | 14 | # iconv in the other direction. 15 | ./table-to "$charset" | sort > tmp-"$charsetf".INVERSE.TXT 16 | 17 | # Check 1: charmap and iconv forward should be identical. 18 | cmp "${srcdir}"/"$charsetf".TXT tmp-"$charsetf".TXT 2> /dev/null 19 | 20 | # Check 2: the difference between the charmap and iconv backward. 21 | sed -e '/ .* 0x/d' < "${srcdir}"/"$charsetf".TXT > tmp-noprecomposed-"$charsetf".TXT 22 | if test -f "${srcdir}"/"$charsetf".IRREVERSIBLE.TXT; then 23 | cat tmp-noprecomposed-"$charsetf".TXT "${srcdir}"/"$charsetf".IRREVERSIBLE.TXT | sort | uniq -u > tmp-orig-"$charsetf".INVERSE.TXT 24 | else 25 | cp tmp-noprecomposed-"$charsetf".TXT tmp-orig-"$charsetf".INVERSE.TXT 26 | fi 27 | cmp tmp-orig-"$charsetf".INVERSE.TXT tmp-"$charsetf".INVERSE.TXT 2> /dev/null 28 | 29 | rm -f tmp-"$charsetf".TXT tmp-"$charsetf".INVERSE.TXT tmp-noprecomposed-"$charsetf".TXT tmp-orig-"$charsetf".INVERSE.TXT 30 | exit 0 31 | # For a new encoding: 32 | # You can create the "$charsetf".TXT like this: 33 | # ./table-from "$charset" > "$charsetf".TXT 34 | # You can create the "$charsetf".IRREVERSIBLE.TXT like this: 35 | # ./table-to "$charset" | sort > "$charsetf".INVERSE.TXT 36 | # diff "$charsetf".TXT "$charsetf".INVERSE.TXT | grep '^[<>]' | sed -e 's,^. ,,' > "$charsetf".IRREVERSIBLE.TXT 37 | -------------------------------------------------------------------------------- /tests/check-stateless.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | REM Complete check of a stateless encoding. 3 | REM Usage: check-stateless.bat SRCDIR CHARSET 4 | 5 | .\table-from %2 > tmp-%2.TXT 6 | .\table-to %2 | sort > tmp-%2.INVERSE.TXT 7 | fc %1\%2.TXT tmp-%2.TXT 8 | 9 | if not exist %1\%2.IRREVERSIBLE.TXT goto ELSE_1 10 | copy /a %1\%2.TXT /a + %1\%2.IRREVERSIBLE.TXT /a tmp 11 | sort < tmp | uniq-u > tmp-orig-%2.INVERSE.TXT 12 | fc tmp-orig-%2.INVERSE.TXT tmp-%2.INVERSE.TXT 13 | del tmp 14 | del tmp-orig-%2.INVERSE.TXT 15 | goto ENDIF_1 16 | :ELSE_1 17 | fc %1\%2.TXT tmp-%2.INVERSE.TXT 18 | :ENDIF_1 19 | 20 | del tmp-%2.TXT 21 | del tmp-%2.INVERSE.TXT 22 | -------------------------------------------------------------------------------- /tests/check-translit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Simple check of transliteration facilities. 3 | # Usage: check-translit SRCDIR FILE FROMCODE TOCODE 4 | srcdir="$1" 5 | file="$2" 6 | fromcode="$3" 7 | tocode="$4" 8 | set -e 9 | ../src/iconv_no_i18n -f "$fromcode" -t "$tocode"//TRANSLIT < "${srcdir}"/"$file"."$fromcode" > tmp 10 | cmp "${srcdir}"/"$file"."$tocode" tmp 11 | rm -f tmp 12 | exit 0 13 | -------------------------------------------------------------------------------- /tests/check-translit.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | REM Simple check of transliteration facilities. 3 | REM Usage: check-translit.bat SRCDIR FILE FROMCODE TOCODE 4 | 5 | ..\src\iconv_no_i18n -f %3 -t %4//TRANSLIT < %1\%2.%3 > tmp 6 | fc %1\%2.%4 tmp 7 | del tmp 8 | -------------------------------------------------------------------------------- /tests/check-translitfailure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Simple check of transliteration failure. 3 | # Usage: check-translitfailure SRCDIR FILE FROMCODE TOCODE 4 | srcdir="$1" 5 | file="$2" 6 | fromcode="$3" 7 | tocode="$4" 8 | ../src/iconv_no_i18n -f "$fromcode" -t "$tocode"//TRANSLIT < "${srcdir}"/"$file"."$fromcode" >/dev/null 2>/dev/null 9 | test $? = 1 10 | exit $? 11 | -------------------------------------------------------------------------------- /tests/gengb18030z.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2005, 2012 Free Software Foundation, Inc. 2 | This file is part of the GNU LIBICONV Library. 3 | 4 | The GNU LIBICONV Library is free software; you can redistribute it 5 | and/or modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either version 2.1 7 | of the License, or (at your option) any later version. 8 | 9 | The GNU LIBICONV Library is distributed in the hope that it will be 10 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with the GNU LIBICONV Library; see the file COPYING.LIB. 16 | If not, see . */ 17 | 18 | /* Creates the beyond-BMP part of the GB18030.TXT reference table. */ 19 | 20 | #include "config.h" 21 | 22 | #include 23 | #include 24 | 25 | #include "binary-io.h" 26 | 27 | int main () 28 | { 29 | int i1, i2, i3, i4, uc; 30 | 31 | #if O_BINARY 32 | SET_BINARY(fileno(stdout)); 33 | #endif 34 | 35 | uc = 0x10000; 36 | for (i1 = 0x90; i1 <= 0xe3; i1++) 37 | for (i2 = 0x30; i2 <= 0x39; i2++) 38 | for (i3 = 0x81; i3 <= 0xfe; i3++) 39 | for (i4 = 0x30; i4 <= 0x39; i4++) { 40 | printf("0x%02X%02X%02X%02X\t0x%X\n", i1, i2, i3, i4, uc); 41 | uc++; 42 | if (uc == 0x110000) 43 | goto done; 44 | } 45 | done: 46 | 47 | if (ferror(stdout) || fclose(stdout)) 48 | exit(1); 49 | exit(0); 50 | } 51 | -------------------------------------------------------------------------------- /tests/genutf8.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2000, 2004-2005, 2012, 2016 Free Software Foundation, Inc. 2 | This file is part of the GNU LIBICONV Library. 3 | 4 | The GNU LIBICONV Library is free software; you can redistribute it 5 | and/or modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either version 2.1 7 | of the License, or (at your option) any later version. 8 | 9 | The GNU LIBICONV Library is distributed in the hope that it will be 10 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with the GNU LIBICONV Library; see the file COPYING.LIB. 16 | If not, see . */ 17 | 18 | /* Creates the UTF-8.TXT reference table. */ 19 | 20 | #include "config.h" 21 | 22 | #include 23 | #include 24 | 25 | #include "binary-io.h" 26 | 27 | int main () 28 | { 29 | int i1, i2, i3; 30 | 31 | #if O_BINARY 32 | SET_BINARY(fileno(stdout)); 33 | #endif 34 | 35 | /* Range 0x0000..0x007f */ 36 | for (i1 = 0; i1 < 0x80; i1++) 37 | printf("0x%02X\t0x%04X\n", i1, i1); 38 | /* Range 0x0080..0x07ff */ 39 | for (i1 = 2; i1 < 32; i1++) 40 | for (i2 = 0; i2 < 64; i2++) 41 | printf("0x%02X%02X\t0x%04X\n", 0xc0+i1,0x80+i2, (i1<<6)+i2); 42 | /* Range 0x0800..0xffff, except 0xd800..0xdfff */ 43 | for (i1 = 0; i1 < 16; i1++) 44 | for (i2 = (i1==0 ? 32 : 0); i2 < 64; i2++) 45 | for (i3 = 0; i3 < 64; i3++) { 46 | int u = (i1<<12)+(i2<<6)+i3; 47 | if (!(u >= 0xd800 && u < 0xe000)) 48 | printf("0x%02X%02X%02X\t0x%04X\n", 0xe0+i1,0x80+i2,0x80+i3, u); 49 | } 50 | 51 | if (ferror(stdout) || fclose(stdout)) 52 | exit(1); 53 | exit(0); 54 | } 55 | -------------------------------------------------------------------------------- /tests/is-native.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2021 Free Software Foundation, Inc. 2 | This file is part of the GNU LIBICONV Library. 3 | 4 | The GNU LIBICONV Library is free software; you can redistribute it 5 | and/or modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either version 2.1 7 | of the License, or (at your option) any later version. 8 | 9 | The GNU LIBICONV Library is distributed in the hope that it will be 10 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with the GNU LIBICONV Library; see the file COPYING.LIB. 16 | If not, see . */ 17 | 18 | #include "config.h" 19 | 20 | #include "qemu.h" 21 | 22 | /* Returns 0 (success) in a native environment. 23 | Returns 1 (failure) in a cross-executing environment, that is, in an 24 | environment where compiled programs use a different libc than the system's 25 | libc. Currently, only QEMU user-mode environments are recognized. */ 26 | 27 | int main () 28 | { 29 | return is_running_under_qemu_user () ? 1 : 0; 30 | } 31 | -------------------------------------------------------------------------------- /tests/test-to-wchar.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2009, 2011 Free Software Foundation, Inc. 2 | This file is part of the GNU LIBICONV Library. 3 | 4 | The GNU LIBICONV Library is free software; you can redistribute it 5 | and/or modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either version 2.1 7 | of the License, or (at your option) any later version. 8 | 9 | The GNU LIBICONV Library is distributed in the hope that it will be 10 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with the GNU LIBICONV Library; see the file COPYING.LIB. 16 | If not, see . */ 17 | 18 | #include "config.h" 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | /* This test checks that the conversion to wchar_t stops correctly when 25 | the input is incomplete. Based on a bug report from 26 | Tristan Gingold . */ 27 | 28 | int main () 29 | { 30 | iconv_t cd = iconv_open ("wchar_t", "UTF-8"); 31 | if (cd == (iconv_t)(-1)) { 32 | /* Skip the test on platforms without wchar_t 33 | (Solaris 2.6, HP-UX 11.00). */ 34 | } else { 35 | char inbuf[2] = { 0xc2, 0xa0 }; 36 | wchar_t outbuf[10]; 37 | 38 | char *inptr = inbuf; 39 | size_t inbytesleft = 1; 40 | char *outptr = (char *) outbuf; 41 | size_t outbytesleft = sizeof (outbuf); 42 | size_t r = iconv (cd, 43 | (ICONV_CONST char **) &inptr, &inbytesleft, 44 | &outptr, &outbytesleft); 45 | 46 | if (!(r == (size_t)(-1) && errno == EINVAL)) 47 | abort (); 48 | } 49 | 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /tools/CP50221-0208-EXT.TXT: -------------------------------------------------------------------------------- 1 | # CP50221, section JIS X 0208, row 0x2D. 2 | 0x01 0x2460 3 | 0x02 0x2461 4 | 0x03 0x2462 5 | 0x04 0x2463 6 | 0x05 0x2464 7 | 0x06 0x2465 8 | 0x07 0x2466 9 | 0x08 0x2467 10 | 0x09 0x2468 11 | 0x0A 0x2469 12 | 0x0B 0x246A 13 | 0x0C 0x246B 14 | 0x0D 0x246C 15 | 0x0E 0x246D 16 | 0x0F 0x246E 17 | 0x10 0x246F 18 | 0x11 0x2470 19 | 0x12 0x2471 20 | 0x13 0x2472 21 | 0x14 0x2473 22 | 0x15 0x2160 23 | 0x16 0x2161 24 | 0x17 0x2162 25 | 0x18 0x2163 26 | 0x19 0x2164 27 | 0x1A 0x2165 28 | 0x1B 0x2166 29 | 0x1C 0x2167 30 | 0x1D 0x2168 31 | 0x1E 0x2169 32 | 0x20 0x3349 33 | 0x21 0x3314 34 | 0x22 0x3322 35 | 0x23 0x334D 36 | 0x24 0x3318 37 | 0x25 0x3327 38 | 0x26 0x3303 39 | 0x27 0x3336 40 | 0x28 0x3351 41 | 0x29 0x3357 42 | 0x2A 0x330D 43 | 0x2B 0x3326 44 | 0x2C 0x3323 45 | 0x2D 0x332B 46 | 0x2E 0x334A 47 | 0x2F 0x333B 48 | 0x30 0x339C 49 | 0x31 0x339D 50 | 0x32 0x339E 51 | 0x33 0x338E 52 | 0x34 0x338F 53 | 0x35 0x33C4 54 | 0x36 0x33A1 55 | 0x3F 0x337B 56 | 0x40 0x301E 57 | 0x41 0x301F 58 | 0x42 0x2116 59 | 0x43 0x33CD 60 | 0x44 0x2121 61 | 0x45 0x32A4 62 | 0x46 0x32A5 63 | 0x47 0x32A6 64 | 0x48 0x32A7 65 | 0x49 0x32A8 66 | 0x4A 0x3231 67 | 0x4B 0x3232 68 | 0x4C 0x3239 69 | 0x4D 0x337E 70 | 0x4E 0x337D 71 | 0x4F 0x337C 72 | 0x53 0x222E 73 | 0x54 0x2211 74 | 0x58 0x221F 75 | 0x59 0x22BF 76 | -------------------------------------------------------------------------------- /tools/CP50221-0212-EXT.TXT: -------------------------------------------------------------------------------- 1 | # CP50221, section JIS X 0212, rows 0x73..0x74. 2 | 0x01 0x2170 3 | 0x02 0x2171 4 | 0x03 0x2172 5 | 0x04 0x2173 6 | 0x05 0x2174 7 | 0x06 0x2175 8 | 0x07 0x2176 9 | 0x08 0x2177 10 | 0x09 0x2178 11 | 0x0A 0x2179 12 | 0x15 0xFF07 13 | 0x16 0xFF02 14 | 0x1A 0x70BB 15 | 0x1B 0x4EFC 16 | 0x1C 0x50F4 17 | 0x1D 0x51EC 18 | 0x1E 0x5307 19 | 0x1F 0x5324 20 | 0x20 0xFA0E 21 | 0x21 0x548A 22 | 0x22 0x5759 23 | 0x23 0xFA0F 24 | 0x24 0xFA10 25 | 0x25 0x589E 26 | 0x26 0x5BEC 27 | 0x27 0x5CF5 28 | 0x28 0x5D53 29 | 0x29 0xFA11 30 | 0x2A 0x5FB7 31 | 0x2B 0x6085 32 | 0x2C 0x6120 33 | 0x2D 0x654E 34 | 0x2F 0x6665 35 | 0x30 0xFA12 36 | 0x31 0xF929 37 | 0x32 0x6801 38 | 0x33 0xFA13 39 | 0x34 0xFA14 40 | 0x35 0x6A6B 41 | 0x36 0x6AE2 42 | 0x37 0x6DF8 43 | 0x38 0x6DF2 44 | 0x39 0x7028 45 | 0x3A 0xFA15 46 | 0x3B 0xFA16 47 | 0x3C 0x7501 48 | 0x3D 0x7682 49 | 0x3E 0x769E 50 | 0x3F 0xFA17 51 | 0x40 0x7930 52 | 0x41 0xFA18 53 | 0x42 0xFA19 54 | 0x43 0xFA1A 55 | 0x44 0xFA1B 56 | 0x45 0x7AE7 57 | 0x46 0xFA1C 58 | 0x47 0xFA1D 59 | 0x48 0x7DA0 60 | 0x49 0x7DD6 61 | 0x4A 0xFA1E 62 | 0x4B 0x8362 63 | 0x4C 0xFA1F 64 | 0x4D 0x85B0 65 | 0x4E 0xFA20 66 | 0x4F 0xFA21 67 | 0x50 0x8807 68 | 0x51 0xFA22 69 | 0x52 0x8B7F 70 | 0x53 0x8CF4 71 | 0x54 0x8D76 72 | 0x55 0xFA23 73 | 0x56 0xFA24 74 | 0x57 0xFA25 75 | 0x58 0x90DE 76 | 0x59 0xFA26 77 | 0x5A 0x9115 78 | 0x5B 0xFA27 79 | 0x5C 0xFA28 80 | 0x5D 0x9592 81 | 0x5E 0xF9DC 82 | 0x5F 0xFA29 83 | 0x60 0x973B 84 | 0x62 0x9751 85 | 0x63 0xFA2A 86 | 0x64 0xFA2B 87 | 0x65 0xFA2C 88 | 0x66 0x999E 89 | 0x67 0x9AD9 90 | 0x68 0x9B72 91 | 0x69 0xFA2D 92 | 0x6A 0x9ED1 93 | 0xA1 0x974D 94 | -------------------------------------------------------------------------------- /windows/iconv.rc: -------------------------------------------------------------------------------- 1 | /* Resources for iconv.exe */ 2 | 3 | #include 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0 7 | PRODUCTVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0 8 | FILEFLAGSMASK 0x3fL /* VS_FFI_FILEFLAGSMASK */ 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L /* VS_FF_DEBUG */ 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x10004L /* VOS_DOS_WINDOWS32 */ 15 | FILETYPE 0x1L /* VFT_APP */ 16 | FILESUBTYPE 0x0L /* VFT2_UNKNOWN */ 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "04090000" /* Lang = US English, Charset = ASCII */ 21 | BEGIN 22 | VALUE "Comments", "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License. You should have received a copy of the GNU General Public License along with this program. If not, see .\0" 23 | VALUE "CompanyName", "Free Software Foundation\0" 24 | VALUE "FileDescription", "GPLed iconv for Windows\0" 25 | VALUE "FileVersion", PACKAGE_VERSION_STRING "\0" 26 | VALUE "InternalName", "iconv.exe\0" 27 | VALUE "LegalCopyright", "Copyright (C) 1999-2022\0" 28 | VALUE "LegalTrademarks", "\0" 29 | VALUE "OriginalFilename", "iconv.exe\0" 30 | VALUE "ProductName", "iconv: character set conversion program\0" 31 | VALUE "ProductVersion", PACKAGE_VERSION_STRING "\0" 32 | END 33 | END 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x0409, 0 /* US English, ASCII */ 37 | END 38 | END 39 | -------------------------------------------------------------------------------- /windows/libiconv.rc: -------------------------------------------------------------------------------- 1 | /* Resources for iconv.dll */ 2 | 3 | #include 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0 7 | PRODUCTVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0 8 | FILEFLAGSMASK 0x3fL /* VS_FFI_FILEFLAGSMASK */ 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L /* VS_FF_DEBUG */ 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x10004L /* VOS_DOS_WINDOWS32 */ 15 | FILETYPE 0x2L /* VFT_DLL */ 16 | FILESUBTYPE 0x0L /* VFT2_UNKNOWN */ 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "04090000" /* Lang = US English, Charset = ASCII */ 21 | BEGIN 22 | VALUE "Comments", "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License. You should have received a copy of the GNU Lesser General Public License along with this library; if not, see .\0" 23 | VALUE "CompanyName", "Free Software Foundation\0" 24 | VALUE "FileDescription", "LGPLed libiconv for Windows\0" 25 | VALUE "FileVersion", PACKAGE_VERSION_STRING "\0" 26 | VALUE "InternalName", "iconv.dll\0" 27 | VALUE "LegalCopyright", "Copyright (C) 1999-2022\0" 28 | VALUE "LegalTrademarks", "\0" 29 | VALUE "OriginalFilename", "iconv.dll\0" 30 | VALUE "ProductName", "libiconv: character set conversion library\0" 31 | VALUE "ProductVersion", PACKAGE_VERSION_STRING "\0" 32 | END 33 | END 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x0409, 0 /* US English, ASCII */ 37 | END 38 | END 39 | -------------------------------------------------------------------------------- /windows/windres-options: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Usage: windres-options [--escape] PACKAGE_VERSION 3 | # Outputs a set of command-line options for 'windres', containing definitions 4 | # for the preprocessor variables 5 | # PACKAGE_VERSION_STRING 6 | # PACKAGE_VERSION_MAJOR 7 | # PACKAGE_VERSION_MINOR 8 | # PACKAGE_VERSION_SUBMINOR 9 | 10 | escape= 11 | if test "$1" = "--escape"; then 12 | escape=yes 13 | shift 14 | fi 15 | version="$1" # something like 2.0 or 2.17 or 2.17.3 or 2.17.3-pre3 16 | 17 | sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} 18 | i\ 19 | 0 20 | q 21 | ' 22 | sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} 23 | i\ 24 | 0 25 | q 26 | ' 27 | sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} 28 | i\ 29 | 0 30 | q 31 | ' 32 | 33 | { 34 | echo "-DPACKAGE_VERSION_STRING=\"${version}\"" 35 | echo "-DPACKAGE_VERSION_MAJOR="`echo "${version}" | sed -n -e "$sed_extract_major"` 36 | echo "-DPACKAGE_VERSION_MINOR="`echo "${version}" | sed -n -e "$sed_extract_minor"` 37 | echo "-DPACKAGE_VERSION_SUBMINOR="`echo "${version}" | sed -n -e "$sed_extract_subminor"` 38 | } | 39 | { 40 | if test -n "$escape"; then 41 | sed -e 's,\(["\\]\),\\\1,g' 42 | else 43 | cat 44 | fi 45 | } 46 | -------------------------------------------------------------------------------- /woe32dll/iconv-exports.c: -------------------------------------------------------------------------------- 1 | /* List of exported symbols of libiconv on Cygwin. 2 | Copyright (C) 2006 Free Software Foundation, Inc. 3 | Written by Bruno Haible , 2006. 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as 7 | published by the Free Software Foundation; either version 2 of the 8 | License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this program; see the file COPYING.LIB. If not, 17 | see . */ 18 | 19 | #include "woe32dll/export.h" 20 | 21 | VARIABLE(_libiconv_version) 22 | --------------------------------------------------------------------------------