diff options
Diffstat (limited to 'Build/source/texk/ptexenc')
-rw-r--r-- | Build/source/texk/ptexenc/ChangeLog | 9 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/Makefile.in | 136 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/aclocal.m4 | 421 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/c-auto.in | 2 | ||||
-rwxr-xr-x | Build/source/texk/ptexenc/configure | 364 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/ptexenc/unicode.h | 3 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/tex8benc.h | 1454 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/unicode.c | 83 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/version.ac | 2 |
9 files changed, 2188 insertions, 286 deletions
diff --git a/Build/source/texk/ptexenc/ChangeLog b/Build/source/texk/ptexenc/ChangeLog index cb4a228f78f..ef1193e27ad 100644 --- a/Build/source/texk/ptexenc/ChangeLog +++ b/Build/source/texk/ptexenc/ChangeLog @@ -1,3 +1,12 @@ +2024-10-20 TANAKA Takuji <ttk@t-lab.opal.ne.jp> + + * unicode.c, ptexenc/unicode.h, tex8benc.h: + Add new functions of encoding conversion between + TeX 8bit encoding and Unicode to support + Unicode for Latin characters in upTeX ver2.00. + * version.ac: Bump to 1.5.1/dev. + https://github.com/texjporg/tex-jp-build/issues/170 + 2024-05-11 TANAKA Takuji <ttk@t-lab.opal.ne.jp> * unicode.c, ptexenc.c: diff --git a/Build/source/texk/ptexenc/Makefile.in b/Build/source/texk/ptexenc/Makefile.in index 37c6a8840fb..d2e94a4a104 100644 --- a/Build/source/texk/ptexenc/Makefile.in +++ b/Build/source/texk/ptexenc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. +# Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2021 Free Software Foundation, Inc. +# Copyright (C) 1994-2024 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -73,6 +73,8 @@ am__make_running_with_option = \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +am__rm_f = rm -f $(am__rm_f_notfound) +am__rm_rf = rm -rf $(am__rm_f_notfound) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -141,10 +143,9 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ + { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = @@ -340,6 +341,7 @@ am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ + $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the @@ -364,6 +366,11 @@ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ +if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ + am__collect_skipped_logs='--collect-skipped-logs no'; \ +else \ + am__collect_skipped_logs=''; \ +fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ @@ -429,20 +436,22 @@ distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ + find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \ + ; rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best +GZIP_ENV = -9 DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print +distcleancheck_listfiles = \ + find . \( -type f -a \! \ + \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -528,8 +537,10 @@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ +am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -668,12 +679,12 @@ ptexenc/c-auto.h: ptexenc/stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) ptexenc/stamp-h1 ptexenc/stamp-h1: $(srcdir)/c-auto.in $(top_builddir)/config.status - @rm -f ptexenc/stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status ptexenc/c-auto.h + $(AM_V_at)rm -f ptexenc/stamp-h1 + $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status ptexenc/c-auto.h $(srcdir)/c-auto.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f ptexenc/stamp-h1 - touch $@ + $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + $(AM_V_at)rm -f ptexenc/stamp-h1 + $(AM_V_at)touch $@ distclean-hdr: -rm -f ptexenc/c-auto.h ptexenc/stamp-h1 @@ -718,16 +729,11 @@ uninstall-binPROGRAMS: `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files + cd "$(DESTDIR)$(bindir)" && $(am__rm_f) $$files clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list + $(am__rm_f) $(bin_PROGRAMS) + test -z "$(EXEEXT)" || $(am__rm_f) $(bin_PROGRAMS:$(EXEEXT)=) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @@ -754,15 +760,13 @@ uninstall-libLTLIBRARIES: done clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + -$(am__rm_f) $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } + echo rm -f $${locs}; \ + $(am__rm_f) $${locs} libptexenc.la: $(libptexenc_la_OBJECTS) $(libptexenc_la_DEPENDENCIES) $(EXTRA_libptexenc_la_DEPENDENCIES) $(AM_V_CCLD)$(libptexenc_la_LINK) -rpath $(libdir) $(libptexenc_la_OBJECTS) $(libptexenc_la_LIBADD) $(LIBS) @@ -785,7 +789,7 @@ distclean-compile: $(am__depfiles_remade): @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + @: >>$@ am--depfiles: $(am__depfiles_remade) @@ -1008,7 +1012,6 @@ distclean-tags: am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: - $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ @@ -1084,10 +1087,37 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ + output_system_information () \ + { \ + echo; \ + { uname -a | $(AWK) '{ \ + printf "System information (uname -a):"; \ + for (i = 1; i < NF; ++i) \ + { \ + if (i != 2) \ + printf " %s", $$i; \ + } \ + printf "\n"; \ +}'; } 2>&1; \ + if test -r /etc/os-release; then \ + echo "Distribution information (/etc/os-release):"; \ + sed 8q /etc/os-release; \ + elif test -r /etc/issue; then \ + echo "Distribution information (/etc/issue):"; \ + cat /etc/issue; \ + fi; \ + }; \ + please_report () \ + { \ +echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ +echo "together with the test-suite.log file (gzipped) and your system"; \ +echo "information. Thanks."; \ + }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ + output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ @@ -1107,26 +1137,25 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ - echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ - echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: - @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list - @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @$(am__rm_f) $(RECHECK_LOGS) + @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) + @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ - trs_list=`for i in $$bases; do echo $$i.trs; done`; \ - log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ @@ -1155,7 +1184,7 @@ distdir: $(BUILT_SOURCES) distdir-am: $(DISTFILES) $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" + $(AM_V_at)$(MKDIR_P) "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1241,7 +1270,7 @@ dist dist-all: distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -1251,7 +1280,7 @@ distcheck: dist *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ @@ -1352,17 +1381,17 @@ install-strip: "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: - -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) - -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) - -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + -$(am__rm_f) $(TEST_LOGS) + -$(am__rm_f) $(TEST_LOGS:.log=.trs) + -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + -$(am__rm_f) $(CLEANFILES) distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + -$(am__rm_f) $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) + -$(am__rm_f) $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1374,7 +1403,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f ./$(DEPDIR)/libptexenc_la-kanjicnv.Plo + -rm -f ./$(DEPDIR)/libptexenc_la-kanjicnv.Plo -rm -f ./$(DEPDIR)/libptexenc_la-ptexenc.Plo -rm -f ./$(DEPDIR)/libptexenc_la-unicode-jp.Plo -rm -f ./$(DEPDIR)/libptexenc_la-unicode.Plo @@ -1427,7 +1456,7 @@ installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -f ./$(DEPDIR)/libptexenc_la-kanjicnv.Plo + -rm -f ./$(DEPDIR)/libptexenc_la-kanjicnv.Plo -rm -f ./$(DEPDIR)/libptexenc_la-ptexenc.Plo -rm -f ./$(DEPDIR)/libptexenc_la-unicode-jp.Plo -rm -f ./$(DEPDIR)/libptexenc_la-unicode.Plo @@ -1513,3 +1542,10 @@ rebuild: $(rebuild_prereq) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: + +# Tell GNU make to disable its built-in pattern rules. +%:: %,v +%:: RCS/%,v +%:: RCS/% +%:: s.% +%:: SCCS/s.% diff --git a/Build/source/texk/ptexenc/aclocal.m4 b/Build/source/texk/ptexenc/aclocal.m4 index 85ae51c3115..1fb7a6300d6 100644 --- a/Build/source/texk/ptexenc/aclocal.m4 +++ b/Build/source/texk/ptexenc/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.5 -*- Autoconf -*- +# generated automatically by aclocal 1.17 -*- Autoconf -*- -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2021 Free Software Foundation, Inc. +# Copyright (C) 2002-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.16' +[am__api_version='1.17' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.5], [], +m4_if([$1], [1.17], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.5])dnl +[AM_AUTOMAKE_VERSION([1.17])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2021 Free Software Foundation, Inc. +# Copyright (C) 2011-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -70,16 +70,18 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_BEFORE([$0], [AC_PROG_AR])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} +: ${ARFLAGS=cr} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [AC_LANG_PUSH([C]) am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], - [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + [am_ar_try='$AR $ARFLAGS libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar @@ -118,7 +120,7 @@ AC_SUBST([AR])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -170,7 +172,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# Copyright (C) 1997-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -201,7 +203,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Copyright (C) 1999-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -333,7 +335,7 @@ AC_CACHE_CHECK([dependency style of $depcc], # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: + # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported @@ -392,7 +394,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Copyright (C) 1999-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -460,7 +462,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -594,7 +596,7 @@ if test -z "$CSCOPE"; then fi AC_SUBST([CSCOPE]) -AC_REQUIRE([AM_SILENT_RULES])dnl +AC_REQUIRE([_AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. @@ -602,47 +604,9 @@ AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. +AC_REQUIRE([_AM_PROG_RM_F]) +AC_REQUIRE([_AM_PROG_XARGS_N]) -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: <https://www.gnu.org/software/coreutils/>. - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. @@ -675,7 +639,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -696,7 +660,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2021 Free Software Foundation, Inc. +# Copyright (C) 2003-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -718,7 +682,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -753,7 +717,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -796,7 +760,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# Copyright (C) 1997-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -830,7 +794,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -859,7 +823,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Copyright (C) 1999-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -906,7 +870,23 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2022-2024 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_RM_F +# --------------- +# Check whether 'rm -f' without any arguments works. +# https://bugs.gnu.org/10828 +AC_DEFUN([_AM_PROG_RM_F], +[am__rm_f_notfound= +AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) +AC_SUBST(am__rm_f_notfound) +]) + +# Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -925,16 +905,169 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# _AM_SLEEP_FRACTIONAL_SECONDS +# ---------------------------- +AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl +AC_CACHE_CHECK([whether sleep supports fractional seconds], + am_cv_sleep_fractional_seconds, [dnl +AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], + [am_cv_sleep_fractional_seconds=no]) +])]) + +# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION +# ----------------------------------- +# Determine the filesystem's resolution for file modification +# timestamps. The coarsest we know of is FAT, with a resolution +# of only two seconds, even with the most recent "exFAT" extensions. +# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one +# nanosecond, matching clock_gettime. However, it is probably not +# possible to delay execution of a shell script for less than one +# millisecond, due to process creation overhead and scheduling +# granularity, so we don't check for anything finer than that. (See below.) +AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl +AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) +AC_CACHE_CHECK([filesystem timestamp resolution], + am_cv_filesystem_timestamp_resolution, [dnl +# Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# <dollar><star>; be careful, easy to get confused.) +if ( + set X `[ls -t conftest.ts[12]]` && + { + test "$[]*" != "X conftest.ts1 conftest.ts2" || + test "$[]*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + _AS_ECHO_UNQUOTED( + ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], + [AS_MESSAGE_LOG_FD]) + AC_MSG_FAILURE([ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment.]) +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$[]2" = conftest.ts3 && + test "$[]3" = conftest.ts2 && + test "$[]4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) +])]) + # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) +[AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) +# This check should not be cached, as it may vary across builds of +# different projects. +AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -953,49 +1086,40 @@ esac # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[]*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$[]2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +AC_MSG_RESULT([$am_build_env_is_sane]) +if test "$am_build_env_is_sane" = no; then + AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT([yes]) + # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & +AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl + ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! -fi +]) AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then @@ -1006,18 +1130,18 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2009-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl +# _AM_SILENT_RULES +# ---------------- +# Enable less verbose build rules support. +AC_DEFUN([_AM_SILENT_RULES], +[AM_DEFAULT_VERBOSITY=1 +AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) @@ -1025,11 +1149,6 @@ AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. @@ -1048,14 +1167,6 @@ am__doit: else am_cv_make_support_nested_variables=no fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl @@ -1064,9 +1175,33 @@ AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls +dnl to AM_SILENT_RULES to change the default value. +AC_CONFIG_COMMANDS_PRE([dnl +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +])dnl ]) -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or +# empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_REQUIRE([_AM_SILENT_RULES]) +AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])]) + +# Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1094,7 +1229,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2021 Free Software Foundation, Inc. +# Copyright (C) 2006-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1113,7 +1248,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2021 Free Software Foundation, Inc. +# Copyright (C) 2004-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1159,15 +1294,19 @@ m4_if([$1], [v7], am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) + if test x$am_uid = xunknown; then + AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) + elif test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT([no]) - _am_tools=none + AC_MSG_RESULT([no]) + _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) + if test x$gm_gid = xunknown; then + AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) + elif test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none @@ -1244,6 +1383,26 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +# Copyright (C) 2022-2024 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_XARGS_N +# ---------------- +# Check whether 'xargs -n' works. It should work everywhere, so the fallback +# is not optimized at all as we never expect to use it. +AC_DEFUN([_AM_PROG_XARGS_N], +[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl +AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) +AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl + am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' +])dnl +AC_SUBST(am__xargs_n) +]) + m4_include([../../m4/kpse-common.m4]) m4_include([../../m4/kpse-kpathsea-flags.m4]) m4_include([../../m4/kpse-lib-version.m4]) diff --git a/Build/source/texk/ptexenc/c-auto.in b/Build/source/texk/ptexenc/c-auto.in index a2b69599a0b..bed65183a32 100644 --- a/Build/source/texk/ptexenc/c-auto.in +++ b/Build/source/texk/ptexenc/c-auto.in @@ -6,7 +6,7 @@ #define PTEXENC_C_AUTO_H /* ptexenc: the version string. */ -#define PTEXENCVERSION "ptexenc version 1.5.0/dev" +#define PTEXENCVERSION "ptexenc version 1.5.1/dev" /* Define to 1 if the 'closedir' function returns void instead of int. */ #undef CLOSEDIR_VOID diff --git a/Build/source/texk/ptexenc/configure b/Build/source/texk/ptexenc/configure index ae23bc745af..2a693e48c66 100755 --- a/Build/source/texk/ptexenc/configure +++ b/Build/source/texk/ptexenc/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for ptexenc 1.5.0/dev. +# Generated by GNU Autoconf 2.72 for ptexenc 1.5.1/dev. # # Report bugs to <tex-k@tug.org>. # @@ -614,8 +614,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ptexenc' PACKAGE_TARNAME='ptexenc' -PACKAGE_VERSION='1.5.0/dev' -PACKAGE_STRING='ptexenc 1.5.0/dev' +PACKAGE_VERSION='1.5.1/dev' +PACKAGE_STRING='ptexenc 1.5.1/dev' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -714,6 +714,8 @@ CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE +am__xargs_n +am__rm_f_notfound AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V @@ -1363,7 +1365,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -'configure' configures ptexenc 1.5.0/dev to adapt to many kinds of systems. +'configure' configures ptexenc 1.5.1/dev to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1434,7 +1436,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ptexenc 1.5.0/dev:";; + short | recursive ) echo "Configuration of ptexenc 1.5.1/dev:";; esac cat <<\_ACEOF @@ -1555,7 +1557,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ptexenc configure 1.5.0/dev +ptexenc configure 1.5.1/dev generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. @@ -2097,7 +2099,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ptexenc $as_me 1.5.0/dev, which was +It was created by ptexenc $as_me 1.5.1/dev, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -2877,13 +2879,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -PTEXENCVERSION=1.5.0/dev +PTEXENCVERSION=1.5.1/dev -PTEXENC_LT_VERSINFO=6:0:5 +PTEXENC_LT_VERSINFO=6:1:5 -am__api_version='1.16' +am__api_version='1.17' @@ -2986,6 +2988,165 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 +printf %s "checking whether sleep supports fractional seconds... " >&6; } +if test ${am_cv_sleep_fractional_seconds+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if sleep 0.001 2>/dev/null +then : + am_cv_sleep_fractional_seconds=yes +else case e in #( + e) am_cv_sleep_fractional_seconds=no ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 +printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 +printf %s "checking filesystem timestamp resolution... " >&6; } +if test ${am_cv_filesystem_timestamp_resolution+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# <dollar><star>; be careful, easy to get confused.) +if ( + set X `ls -t conftest.ts[12]` && + { + test "$*" != "X conftest.ts1 conftest.ts2" || + test "$*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment. +See 'config.log' for more details" "$LINENO" 5; } +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$2" = conftest.ts3 && + test "$3" = conftest.ts2 && + test "$4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 +printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } + +# This check should not be cached, as it may vary across builds of +# different projects. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory @@ -3006,49 +3167,45 @@ esac # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 +printf "%s\n" "$am_build_env_is_sane" >&6; } +if test "$am_build_env_is_sane" = no; then + as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & +if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 +then : + +else case e in #( + e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! + ;; +esac fi rm -f conftest.file @@ -3338,17 +3495,13 @@ else fi rmdir .tst 2>/dev/null +AM_DEFAULT_VERBOSITY=1 # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } @@ -3371,15 +3524,45 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi AM_BACKSLASH='\' +am__rm_f_notfound= +if (rm -f && rm -fr && rm -rf) 2>/dev/null +then : + +else case e in #( + e) am__rm_f_notfound='""' ;; +esac +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 +printf %s "checking xargs -n works... " >&6; } +if test ${am_cv_xargs_n_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3" +then : + am_cv_xargs_n_works=yes +else case e in #( + e) am_cv_xargs_n_works=no ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 +printf "%s\n" "$am_cv_xargs_n_works" >&6; } +if test "$am_cv_xargs_n_works" = yes +then : + am__xargs_n='xargs -n' +else case e in #( + e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' + ;; +esac +fi + @@ -4626,7 +4809,7 @@ else case e in #( # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: + # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported @@ -8816,7 +8999,7 @@ fi # Define the identity of the package. PACKAGE='ptexenc' - VERSION='1.5.0/dev' + VERSION='1.5.1/dev' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -8877,47 +9060,9 @@ fi -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: <https://www.gnu.org/software/coreutils/>. - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi # am_maintainer_mode @@ -9161,6 +9306,7 @@ esac fi : ${AR=ar} +: ${ARFLAGS=cr} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 printf %s "checking the archiver ($AR) interface... " >&6; } @@ -9181,7 +9327,7 @@ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO" then : - am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' + am_ar_try='$AR $ARFLAGS libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? @@ -15169,7 +15315,7 @@ Usage: $0 [OPTIONS] Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ -ptexenc config.lt 1.5.0/dev +ptexenc config.lt 1.5.1/dev configured by $0, generated by GNU Autoconf 2.72. Copyright (C) 2011 Free Software Foundation, Inc. @@ -16522,6 +16668,18 @@ printf %s "checking that generated files are newer than configure... " >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi + if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -16941,7 +17099,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ptexenc $as_me 1.5.0/dev, which was +This file was extended by ptexenc $as_me 1.5.1/dev, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17009,7 +17167,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -ptexenc config.status 1.5.0/dev +ptexenc config.status 1.5.1/dev configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" diff --git a/Build/source/texk/ptexenc/ptexenc/unicode.h b/Build/source/texk/ptexenc/ptexenc/unicode.h index 0326b3fa901..858d9cbe1f2 100644 --- a/Build/source/texk/ptexenc/ptexenc/unicode.h +++ b/Build/source/texk/ptexenc/ptexenc/unicode.h @@ -26,6 +26,9 @@ extern long UVS_get_codepoint_in_sequence(long ucv, int n); extern long UVS_combine_code(long ucv, long uvs); extern long UVS_divide_code(long code, long* uvs); +extern long ptenc_ucs_to_8bit_code(short enc, long uch); +extern long ptenc_8bit_code_to_ucs(short enc, long ech); + #define LONG(a,b,c,d) ( ((long)(a)<<24) | ((long)(b)<<16) | ((c)<<8) | (d) ) #define BYTE1(x) (((x)>>24) & 0xff) #define BYTE2(x) (((x)>>16) & 0xff) diff --git a/Build/source/texk/ptexenc/tex8benc.h b/Build/source/texk/ptexenc/tex8benc.h new file mode 100644 index 00000000000..2f0351b307c --- /dev/null +++ b/Build/source/texk/ptexenc/tex8benc.h @@ -0,0 +1,1454 @@ +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef TEX8BENC_H +#define TEX8BENC_H + +/* UCS -> T1 mapping table */ +static unsigned short UCStoT1enc[] = { + /* from, to */ + 0xA1, 0xBD, + 0xA3, 0xBB, + 0xA7, 0x9F, + 0xA8, 0x04, + 0xAB, 0x13, + 0xAF, 0x09, + 0xB4, 0x01, + 0xB8, 0x0B, + 0xBB, 0x14, + 0xBF, 0xBE, + 0xC0, 0xC0, // LATIN CAPITAL LETTER A WITH GRAVE + 0xC1, 0xC1, // LATIN CAPITAL LETTER A WITH ACUTE + 0xC2, 0xC2, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX + 0xC3, 0xC3, // LATIN CAPITAL LETTER A WITH TILDE + 0xC4, 0xC4, // LATIN CAPITAL LETTER A WITH DIAERESIS + 0xC5, 0xC5, // LATIN CAPITAL LETTER A WITH RING ABOVE + 0xC6, 0xC6, // LATIN CAPITAL LETTER AE + 0xC7, 0xC7, // LATIN CAPITAL LETTER C WITH CEDILLA + 0xC8, 0xC8, // LATIN CAPITAL LETTER E WITH GRAVE + 0xC9, 0xC9, // LATIN CAPITAL LETTER E WITH ACUTE + 0xCA, 0xCA, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX + 0xCB, 0xCB, // LATIN CAPITAL LETTER E WITH DIAERESIS + 0xCC, 0xCC, // LATIN CAPITAL LETTER I WITH GRAVE + 0xCD, 0xCD, // LATIN CAPITAL LETTER I WITH ACUTE + 0xCE, 0xCE, // LATIN CAPITAL LETTER I WITH CIRCUMFLEX + 0xCF, 0xCF, // LATIN CAPITAL LETTER I WITH DIAERESIS + 0xD0, 0xD0, // LATIN CAPITAL LETTER ETH + 0xD1, 0xD1, // LATIN CAPITAL LETTER N WITH TILDE + 0xD2, 0xD2, // LATIN CAPITAL LETTER O WITH GRAVE + 0xD3, 0xD3, // LATIN CAPITAL LETTER O WITH ACUTE + 0xD4, 0xD4, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX + 0xD5, 0xD5, // LATIN CAPITAL LETTER O WITH TILDE + 0xD6, 0xD6, // LATIN CAPITAL LETTER O WITH DIAERESIS + 0xD8, 0xD8, // LATIN CAPITAL LETTER O WITH STROKE + 0xD9, 0xD9, // LATIN CAPITAL LETTER U WITH GRAVE + 0xDA, 0xDA, // LATIN CAPITAL LETTER U WITH ACUTE + 0xDB, 0xDB, // LATIN CAPITAL LETTER U WITH CIRCUMFLEX + 0xDC, 0xDC, // LATIN CAPITAL LETTER U WITH DIAERESIS + 0xDD, 0xDD, // LATIN CAPITAL LETTER Y WITH ACUTE + 0xDE, 0xDE, // LATIN CAPITAL LETTER THORN + 0xDF, 0xFF, // LATIN SMALL LETTER SHARP S + 0xE0, 0xE0, // LATIN SMALL LETTER A WITH GRAVE + 0xE1, 0xE1, // LATIN SMALL LETTER A WITH ACUTE + 0xE2, 0xE2, // LATIN SMALL LETTER A WITH CIRCUMFLEX + 0xE3, 0xE3, // LATIN SMALL LETTER A WITH TILDE + 0xE4, 0xE4, // LATIN SMALL LETTER A WITH DIAERESIS + 0xE5, 0xE5, // LATIN SMALL LETTER A WITH RING ABOVE + 0xE6, 0xE6, // LATIN SMALL LETTER AE + 0xE7, 0xE7, // LATIN SMALL LETTER C WITH CEDILLA + 0xE8, 0xE8, // LATIN SMALL LETTER E WITH GRAVE + 0xE9, 0xE9, // LATIN SMALL LETTER E WITH ACUTE + 0xEA, 0xEA, // LATIN SMALL LETTER E WITH CIRCUMFLEX + 0xEB, 0xEB, // LATIN SMALL LETTER E WITH DIAERESIS + 0xEC, 0xEC, // LATIN SMALL LETTER I WITH GRAVE + 0xED, 0xED, // LATIN SMALL LETTER I WITH ACUTE + 0xEE, 0xEE, // LATIN SMALL LETTER I WITH CIRCUMFLEX + 0xEF, 0xEF, // LATIN SMALL LETTER I WITH DIAERESIS + 0xF0, 0xF0, // LATIN SMALL LETTER ETH + 0xF1, 0xF1, // LATIN SMALL LETTER N WITH TILDE + 0xF2, 0xF2, // LATIN SMALL LETTER O WITH GRAVE + 0xF3, 0xF3, // LATIN SMALL LETTER O WITH ACUTE + 0xF4, 0xF4, // LATIN SMALL LETTER O WITH CIRCUMFLEX + 0xF5, 0xF5, // LATIN SMALL LETTER O WITH TILDE + 0xF6, 0xF6, // LATIN SMALL LETTER O WITH DIAERESIS + 0xF8, 0xF8, // LATIN SMALL LETTER O WITH STROKE + 0xF9, 0xF9, // LATIN SMALL LETTER U WITH GRAVE + 0xFA, 0xFA, // LATIN SMALL LETTER U WITH ACUTE + 0xFB, 0xFB, // LATIN SMALL LETTER U WITH CIRCUMFLEX + 0xFC, 0xFC, // LATIN SMALL LETTER U WITH DIAERESIS + 0xFD, 0xFD, // LATIN SMALL LETTER Y WITH ACUTE + 0xFE, 0xFE, // LATIN SMALL LETTER THORN + 0xFF, 0xB8, // LATIN SMALL LETTER Y WITH DIAERESIS + 0x102, 0x80, // LATIN CAPITAL LETTER A WITH BREVE + 0x103, 0xA0, // LATIN SMALL LETTER A WITH BREVE + 0x104, 0x81, // LATIN CAPITAL LETTER A WITH OGONEK + 0x105, 0xA1, // LATIN SMALL LETTER A WITH OGONEK + 0x106, 0x82, // LATIN CAPITAL LETTER C WITH ACUTE + 0x107, 0xA2, // LATIN SMALL LETTER C WITH ACUTE + 0x10C, 0x83, // LATIN CAPITAL LETTER C WITH CARON + 0x10D, 0xA3, // LATIN SMALL LETTER C WITH CARON + 0x10E, 0x84, // LATIN CAPITAL LETTER D WITH CARON + 0x10F, 0xA4, // LATIN SMALL LETTER D WITH CARON + 0x110, 0xD0, // LATIN CAPITAL LETTER D WITH STROKE + 0x111, 0x9E, // LATIN SMALL LETTER D WITH STROKE + 0x118, 0x86, // LATIN CAPITAL LETTER E WITH OGONEK + 0x119, 0xA6, // LATIN SMALL LETTER E WITH OGONEK + 0x11A, 0x85, // LATIN CAPITAL LETTER E WITH CARON + 0x11B, 0xA5, // LATIN SMALL LETTER E WITH CARON + 0x11E, 0x87, // LATIN CAPITAL LETTER G WITH BREVE + 0x11F, 0xA7, // LATIN SMALL LETTER G WITH BREVE + 0x130, 0x9D, // LATIN CAPITAL LETTER I WITH DOT ABOVE + 0x131, 0x19, // LATIN SMALL LETTER DOTLESS I + 0x132, 0x9C, // LATIN CAPITAL LIGATURE IJ + 0x133, 0xBC, // LATIN SMALL LIGATURE IJ + 0x139, 0x88, // LATIN CAPITAL LETTER L WITH ACUTE + 0x13A, 0xA8, // LATIN SMALL LETTER L WITH ACUTE + 0x13D, 0x89, // LATIN CAPITAL LETTER L WITH CARON + 0x13E, 0xA9, // LATIN SMALL LETTER L WITH CARON + 0x141, 0x8A, // LATIN CAPITAL LETTER L WITH STROKE + 0x142, 0xAA, // LATIN SMALL LETTER L WITH STROKE + 0x143, 0x8B, // LATIN CAPITAL LETTER N WITH ACUTE + 0x144, 0xAB, // LATIN SMALL LETTER N WITH ACUTE + 0x147, 0x8C, // LATIN CAPITAL LETTER N WITH CARON + 0x148, 0xAC, // LATIN SMALL LETTER N WITH CARON + 0x14A, 0x8D, // LATIN CAPITAL LETTER ENG + 0x14B, 0xAD, // LATIN SMALL LETTER ENG + 0x150, 0x8E, // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE + 0x151, 0xAE, // LATIN SMALL LETTER O WITH DOUBLE ACUTE + 0x152, 0xD7, // LATIN CAPITAL LIGATURE OE + 0x153, 0xF7, // LATIN SMALL LIGATURE OE + 0x154, 0x8F, // LATIN CAPITAL LETTER R WITH ACUTE + 0x155, 0xAF, // LATIN SMALL LETTER R WITH ACUTE + 0x158, 0x90, // LATIN CAPITAL LETTER R WITH CARON + 0x159, 0xB0, // LATIN SMALL LETTER R WITH CARON + 0x15A, 0x91, // LATIN CAPITAL LETTER S WITH ACUTE + 0x15B, 0xB1, // LATIN SMALL LETTER S WITH ACUTE + 0x15E, 0x93, // LATIN CAPITAL LETTER S WITH CEDILLA + 0x15F, 0xB3, // LATIN SMALL LETTER S WITH CEDILLA + 0x160, 0x92, // LATIN CAPITAL LETTER S WITH CARON + 0x161, 0xB2, // LATIN SMALL LETTER S WITH CARON + 0x162, 0x95, // LATIN CAPITAL LETTER T WITH CEDILLA + 0x163, 0xB5, // LATIN SMALL LETTER T WITH CEDILLA + 0x164, 0x94, // LATIN CAPITAL LETTER T WITH CARON + 0x165, 0xB4, // LATIN SMALL LETTER T WITH CARON + 0x16E, 0x97, // LATIN CAPITAL LETTER U WITH RING ABOVE + 0x16F, 0xB7, // LATIN SMALL LETTER U WITH RING ABOVE + 0x170, 0x96, // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE + 0x171, 0xB6, // LATIN SMALL LETTER U WITH DOUBLE ACUTE + 0x178, 0x98, // LATIN CAPITAL LETTER Y WITH DIAERESIS + 0x179, 0x99, // LATIN CAPITAL LETTER Z WITH ACUTE + 0x17A, 0xB9, // LATIN SMALL LETTER Z WITH ACUTE + 0x17B, 0x9B, // LATIN CAPITAL LETTER Z WITH DOT ABOVE + 0x17C, 0xBB, // LATIN SMALL LETTER Z WITH DOT ABOVE + 0x17D, 0x9A, // LATIN CAPITAL LETTER Z WITH CARON + 0x17E, 0xBA, // LATIN SMALL LETTER Z WITH CARON + 0x237, 0x1A, // LATIN SMALL LETTER DOTLESS J + 0x2C6, 0x02, + 0x2C7, 0x07, + 0x2D8, 0x08, + 0x2D9, 0x0A, + 0x2DA, 0x06, + 0x2DB, 0x0C, + 0x2DC, 0x03, + 0x2DD, 0x05, + 0x1E9E, 0xDF, + 0x200C, 0x17, + 0x2010, 0x7F, + 0x2013, 0x15, + 0x2014, 0x16, + 0x2018, 0x60, + 0x2019, 0x27, + 0x201A, 0x0D, + 0x201C, 0x10, + 0x201D, 0x11, + 0x201E, 0x12, + 0x2039, 0x0E, + 0x203A, 0x0F, + 0x2423, 0x20, +}; + +/* UCS -> TS1 mapping table */ +static unsigned short UCStoTS1enc[] = { + /* from, to */ + 0xA2, 0xA2, + 0xA3, 0xA3, + 0xA4, 0xA4, + 0xA5, 0xA5, + 0xA6, 0xA6, + 0xA7, 0xA7, + 0xA8, 0xA8, + 0xA9, 0xA9, + 0xAA, 0xAA, + 0xAC, 0xAC, + 0xAE, 0xAE, + 0xAF, 0xAF, + 0xB0, 0xB0, + 0xB1, 0xB1, + 0xB2, 0xB2, + 0xB3, 0xB3, + 0xB4, 0xB4, + 0xB5, 0xB5, + 0xB6, 0xB6, + 0xB7, 0xB7, + 0xB8, 0x0B, + 0xB9, 0xB9, + 0xBA, 0xBA, + 0xBC, 0xBC, + 0xBD, 0xBD, + 0xBE, 0xBE, + 0xD7, 0xD6, + 0xF7, 0xF6, + 0x17F, 0x73, // LATIN SMALL LETTER LONG S + 0x192, 0x8C, // LATIN SMALL LETTER F WITH HOOK + 0x2C7, 0x81, + 0x2D8, 0x80, + 0x2DB, 0x0C, + 0x2DD, 0x82, + 0x2F7, 0x7E, + 0xE3F, 0x9A, + 0x2016, 0x86, + 0x2020, 0x84, + 0x2021, 0x85, + 0x2022, 0x88, + 0x2030, 0x87, + 0x2031, 0x98, + 0x203B, 0xB8, + 0x203D, 0x94, + 0x2044, 0x2F, + 0x2045, 0xA0, + 0x2046, 0xA1, + 0x204E, 0x2A, + 0x2052, 0x9C, + 0x20A1, 0x8D, + 0x20A4, 0x92, + 0x20A6, 0x8F, + 0x20A9, 0x8E, + 0x20AB, 0x96, + 0x20AC, 0xBF, + 0x20B1, 0x91, + 0x20B2, 0x90, + 0x2103, 0x89, + 0x2116, 0x9B, + 0x2117, 0xAD, + 0x211E, 0x93, + 0x2120, 0x9F, + 0x2122, 0x97, + 0x2126, 0x57, + 0x2127, 0x4D, + 0x212E, 0x9E, + 0x2190, 0x18, + 0x2191, 0x5E, + 0x2192, 0x19, + 0x2193, 0x5F, + 0x2212, 0x3D, + 0x221A, 0xBB, + 0x2329, 0x3C, + 0x232A, 0x3E, + 0x2422, 0x20, + 0x25E6, 0x9E, + 0x25EF, 0x4F, + 0x2605, 0x62, + 0x266A, 0x6E, + 0x26AD, 0x6D, + 0x26AE, 0x63, + 0x271D, 0x64, + 0x27E6, 0x5B, + 0x27E7, 0x5D, + 0x2E17, 0x2D, + // 0x2E17, 0x7F, + 0x2E18, 0x95, +}; + +/* UCS -> LY1 mapping table */ +static unsigned short UCStoLY1enc[] = { + /* from, to */ + 0xA0, 0xA0, + 0xA1, 0xA1, + 0xA2, 0xA2, + 0xA3, 0xA3, + 0xA4, 0xA4, + 0xA5, 0xA5, + 0xA6, 0xA6, + 0xA7, 0xA7, + 0xA8, 0x7F, +// 0xA8, 0xA8, + 0xA9, 0xA9, + 0xAA, 0xAA, + 0xAB, 0xAB, + 0xAC, 0xAC, + 0xAD, 0xAD, + 0xAE, 0xAE, + 0xAF, 0x16, +// 0xAF, 0xAF, + 0xB0, 0xB0, + 0xB1, 0xB1, + 0xB2, 0xB2, + 0xB3, 0xB3, + 0xB4, 0x13, +// 0xB4, 0xB4, + 0xB5, 0xB5, + 0xB6, 0xB6, + 0xB7, 0xB7, + 0xB8, 0x18, +// 0xB8, 0xB8, + 0xB9, 0xB9, + 0xBA, 0xBA, + 0xBB, 0xBB, + 0xBC, 0xBC, + 0xBD, 0xBD, + 0xBE, 0xBE, + 0xBF, 0xBF, + 0xC0, 0xC0, // LATIN CAPITAL LETTER A WITH GRAVE + 0xC1, 0xC1, // LATIN CAPITAL LETTER A WITH ACUTE + 0xC2, 0xC2, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX + 0xC3, 0xC3, // LATIN CAPITAL LETTER A WITH TILDE + 0xC4, 0xC4, // LATIN CAPITAL LETTER A WITH DIAERESIS + 0xC5, 0xC5, // LATIN CAPITAL LETTER A WITH RING ABOVE + 0xC6, 0x1D, // LATIN CAPITAL LETTER AE +// 0xC6, 0xC6, + 0xC7, 0xC7, // LATIN CAPITAL LETTER C WITH CEDILLA + 0xC8, 0xC8, // LATIN CAPITAL LETTER E WITH GRAVE + 0xC9, 0xC9, // LATIN CAPITAL LETTER E WITH ACUTE + 0xCA, 0xCA, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX + 0xCB, 0xCB, // LATIN CAPITAL LETTER E WITH DIAERESIS + 0xCC, 0xCC, // LATIN CAPITAL LETTER I WITH GRAVE + 0xCD, 0xCD, // LATIN CAPITAL LETTER I WITH ACUTE + 0xCE, 0xCE, // LATIN CAPITAL LETTER I WITH CIRCUMFLEX + 0xCF, 0xCF, // LATIN CAPITAL LETTER I WITH DIAERESIS + 0xD0, 0xD0, // LATIN CAPITAL LETTER ETH + 0xD1, 0xD1, // LATIN CAPITAL LETTER N WITH TILDE + 0xD2, 0xD2, // LATIN CAPITAL LETTER O WITH GRAVE + 0xD3, 0xD3, // LATIN CAPITAL LETTER O WITH ACUTE + 0xD4, 0xD4, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX + 0xD5, 0xD5, // LATIN CAPITAL LETTER O WITH TILDE + 0xD6, 0xD6, // LATIN CAPITAL LETTER O WITH DIAERESIS + 0xD7, 0xD7, + 0xD8, 0x1F, // LATIN CAPITAL LETTER O WITH STROKE +// 0xD8, 0xD8, + 0xD9, 0xD9, // LATIN CAPITAL LETTER U WITH GRAVE + 0xDA, 0xDA, // LATIN CAPITAL LETTER U WITH ACUTE + 0xDB, 0xDB, // LATIN CAPITAL LETTER U WITH CIRCUMFLEX + 0xDC, 0xDC, // LATIN CAPITAL LETTER U WITH DIAERESIS + 0xDD, 0xDD, // LATIN CAPITAL LETTER Y WITH ACUTE + 0xDE, 0xDE, // LATIN CAPITAL LETTER THORN + 0xDF, 0x19, // LATIN SMALL LETTER SHARP S +// 0xDF, 0xDF, + 0xE0, 0xE0, // LATIN SMALL LETTER A WITH GRAVE + 0xE1, 0xE1, // LATIN SMALL LETTER A WITH ACUTE + 0xE2, 0xE2, // LATIN SMALL LETTER A WITH CIRCUMFLEX + 0xE3, 0xE3, // LATIN SMALL LETTER A WITH TILDE + 0xE4, 0xE4, // LATIN SMALL LETTER A WITH DIAERESIS + 0xE5, 0xE5, // LATIN SMALL LETTER A WITH RING ABOVE + 0xE6, 0x1A, // LATIN SMALL LETTER AE +// 0xE6, 0xE6, + 0xE7, 0xE7, // LATIN SMALL LETTER C WITH CEDILLA + 0xE8, 0xE8, // LATIN SMALL LETTER E WITH GRAVE + 0xE9, 0xE9, // LATIN SMALL LETTER E WITH ACUTE + 0xEA, 0xEA, // LATIN SMALL LETTER E WITH CIRCUMFLEX + 0xEB, 0xEB, // LATIN SMALL LETTER E WITH DIAERESIS + 0xEC, 0xEC, // LATIN SMALL LETTER I WITH GRAVE + 0xED, 0xED, // LATIN SMALL LETTER I WITH ACUTE + 0xEE, 0xEE, // LATIN SMALL LETTER I WITH CIRCUMFLEX + 0xEF, 0xEF, // LATIN SMALL LETTER I WITH DIAERESIS + 0xF0, 0xF0, // LATIN SMALL LETTER ETH + 0xF1, 0xF1, // LATIN SMALL LETTER N WITH TILDE + 0xF2, 0xF2, // LATIN SMALL LETTER O WITH GRAVE + 0xF3, 0xF3, // LATIN SMALL LETTER O WITH ACUTE + 0xF4, 0xF4, // LATIN SMALL LETTER O WITH CIRCUMFLEX + 0xF5, 0xF5, // LATIN SMALL LETTER O WITH TILDE + 0xF6, 0xF6, // LATIN SMALL LETTER O WITH DIAERESIS + 0xF7, 0xF7, + 0xF8, 0x1C, // LATIN SMALL LETTER O WITH STROKE +// 0xF8, 0xF8, + 0xF9, 0xF9, // LATIN SMALL LETTER U WITH GRAVE + 0xFA, 0xFA, // LATIN SMALL LETTER U WITH ACUTE + 0xFB, 0xFB, // LATIN SMALL LETTER U WITH CIRCUMFLEX + 0xFC, 0xFC, // LATIN SMALL LETTER U WITH DIAERESIS + 0xFD, 0xFD, // LATIN SMALL LETTER Y WITH ACUTE + 0xFE, 0xFE, // LATIN SMALL LETTER THORN + 0xFF, 0xFF, // LATIN SMALL LETTER Y WITH DIAERESIS + 0x131, 0x10, // LATIN SMALL LETTER DOTLESS I + 0x141, 0x80, // LATIN CAPITAL LETTER L WITH STROKE + 0x142, 0x90, // LATIN SMALL LETTER L WITH STROKE + 0x152, 0x1E, // LATIN CAPITAL LIGATURE OE +// 0x152, 0x8C, + 0x153, 0x1B, // LATIN SMALL LIGATURE OE +// 0x153, 0x9C, + 0x160, 0x8A, // LATIN CAPITAL LETTER S WITH CARON + 0x161, 0x9A, // LATIN SMALL LETTER S WITH CARON + 0x178, 0x9F, // LATIN CAPITAL LETTER Y WITH DIAERESIS + 0x17D, 0x8D, // LATIN CAPITAL LETTER Z WITH CARON + 0x17E, 0x9D, // LATIN SMALL LETTER Z WITH CARON + 0x192, 0x83, // LATIN SMALL LETTER F WITH HOOK + 0x237, 0x11, // LATIN SMALL LETTER DOTLESS J + 0x2C6, 0x5E, +// 0x2C6, 0x88, + 0x2C7, 0x14, + 0x2D8, 0x15, + 0x2D9, 0x05, + 0x2DA, 0x17, + 0x2DB, 0x07, + 0x2DC, 0x7E, +// 0x2DC, 0x98, + 0x2DD, 0x06, + 0x200C, 0x0A, + 0x2013, 0x96, + 0x2014, 0x97, + 0x2018, 0x60, +// 0x2018, 0x91, + 0x2019, 0x27, +// 0x2019, 0x92, + 0x201A, 0x82, + 0x201C, 0x93, + 0x201D, 0x94, + 0x201E, 0x84, + 0x2020, 0x86, + 0x2021, 0x87, + 0x2022, 0x95, + 0x2026, 0x85, + 0x2030, 0x89, + 0x2039, 0x8B, + 0x203A, 0x9B, + 0x2044, 0x04, + 0x20AC, 0x01, + 0x2122, 0x99, + 0x2212, 0x8F, +}; + +/* UCS -> T5 mapping table */ +static unsigned short UCStoT5enc[] = { + /* from, to */ + 0xA8, 0x04, + 0xAB, 0x13, + 0xAF, 0x09, + 0xB4, 0x01, + 0xB8, 0x0B, + 0xBB, 0x14, + 0xC0, 0x80, // LATIN CAPITAL LETTER A WITH GRAVE + 0xC1, 0x81, // LATIN CAPITAL LETTER A WITH ACUTE + 0xC2, 0x85, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX + 0xC3, 0x82, // LATIN CAPITAL LETTER A WITH TILDE + 0xC8, 0x91, // LATIN CAPITAL LETTER E WITH GRAVE + 0xC9, 0x92, // LATIN CAPITAL LETTER E WITH ACUTE + 0xCA, 0x96, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX + 0xCC, 0x9C, // LATIN CAPITAL LETTER I WITH GRAVE + 0xCD, 0x9D, // LATIN CAPITAL LETTER I WITH ACUTE + 0xD2, 0xC1, // LATIN CAPITAL LETTER O WITH GRAVE + 0xD3, 0xC2, // LATIN CAPITAL LETTER O WITH ACUTE + 0xD4, 0xC6, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX + 0xD5, 0xC3, // LATIN CAPITAL LETTER O WITH TILDE + 0xD9, 0xD2, // LATIN CAPITAL LETTER U WITH GRAVE + 0xDA, 0xD3, // LATIN CAPITAL LETTER U WITH ACUTE + 0xDD, 0xDE, // LATIN CAPITAL LETTER Y WITH ACUTE + 0xE0, 0xA0, // LATIN SMALL LETTER A WITH GRAVE + 0xE1, 0xA1, // LATIN SMALL LETTER A WITH ACUTE + 0xE2, 0xA5, // LATIN SMALL LETTER A WITH CIRCUMFLEX + 0xE3, 0xA2, // LATIN SMALL LETTER A WITH TILDE + 0xE8, 0xB1, // LATIN SMALL LETTER E WITH GRAVE + 0xE9, 0xB2, // LATIN SMALL LETTER E WITH ACUTE + 0xEA, 0xB6, // LATIN SMALL LETTER E WITH CIRCUMFLEX + 0xEC, 0xBC, // LATIN SMALL LETTER I WITH GRAVE + 0xED, 0xBD, // LATIN SMALL LETTER I WITH ACUTE + 0xF2, 0xE1, // LATIN SMALL LETTER O WITH GRAVE + 0xF3, 0xE2, // LATIN SMALL LETTER O WITH ACUTE + 0xF4, 0xE6, // LATIN SMALL LETTER O WITH CIRCUMFLEX + 0xF5, 0xE3, // LATIN SMALL LETTER O WITH TILDE + 0xF9, 0xF2, // LATIN SMALL LETTER U WITH GRAVE + 0xFA, 0xF3, // LATIN SMALL LETTER U WITH ACUTE + 0xFD, 0xFE, // LATIN SMALL LETTER Y WITH ACUTE + 0x102, 0x8B, // LATIN CAPITAL LETTER A WITH BREVE + 0x103, 0xAB, // LATIN SMALL LETTER A WITH BREVE + 0x110, 0x1E, // LATIN CAPITAL LETTER D WITH STROKE + 0x111, 0x1F, // LATIN SMALL LETTER D WITH STROKE + 0x128, 0x9E, // LATIN CAPITAL LETTER I WITH TILDE + 0x129, 0xBE, // LATIN SMALL LETTER I WITH TILDE + 0x131, 0x19, // LATIN SMALL LETTER DOTLESS I + 0x168, 0xD4, // LATIN CAPITAL LETTER U WITH TILDE + 0x169, 0xF4, // LATIN SMALL LETTER U WITH TILDE + 0x1A0, 0xCC, // LATIN CAPITAL LETTER O WITH HORN + 0x1A1, 0xEC, // LATIN SMALL LETTER O WITH HORN + 0x1AF, 0xD7, // LATIN CAPITAL LETTER U WITH HORN + 0x1B0, 0xF7, // LATIN SMALL LETTER U WITH HORN + 0x2C6, 0x02, + 0x2C7, 0x07, + 0x2D8, 0x08, + 0x2D9, 0x0A, + 0x2DA, 0x06, + 0x2DC, 0x03, + 0x309, 0x0C, + 0x323, 0x05, + 0x1EA0, 0x84, // LATIN CAPITAL LETTER A WITH DOT BELOW + 0x1EA1, 0xA4, // LATIN SMALL LETTER A WITH DOT BELOW + 0x1EA2, 0x83, // LATIN CAPITAL LETTER A WITH HOOK ABOVE + 0x1EA3, 0xA3, // LATIN SMALL LETTER A WITH HOOK ABOVE + 0x1EA4, 0x87, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE + 0x1EA5, 0xA7, // LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE + 0x1EA6, 0x86, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE + 0x1EA7, 0xA6, // LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE + 0x1EA8, 0x89, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE + 0x1EA9, 0xA9, // LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE + 0x1EAA, 0x88, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE + 0x1EAB, 0xA8, // LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE + 0x1EAC, 0x8A, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW + 0x1EAD, 0xAA, // LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW + 0x1EAE, 0x8D, // LATIN CAPITAL LETTER A WITH BREVE AND ACUTE + 0x1EAF, 0xAD, // LATIN SMALL LETTER A WITH BREVE AND ACUTE + 0x1EB0, 0x8C, // LATIN CAPITAL LETTER A WITH BREVE AND GRAVE + 0x1EB1, 0xAC, // LATIN SMALL LETTER A WITH BREVE AND GRAVE + 0x1EB2, 0x8F, // LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE + 0x1EB3, 0xAF, // LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE + 0x1EB4, 0x8E, // LATIN CAPITAL LETTER A WITH BREVE AND TILDE + 0x1EB5, 0xAE, // LATIN SMALL LETTER A WITH BREVE AND TILDE + 0x1EB6, 0x90, // LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW + 0x1EB7, 0xB0, // LATIN SMALL LETTER A WITH BREVE AND DOT BELOW + 0x1EB8, 0x95, // LATIN CAPITAL LETTER E WITH DOT BELOW + 0x1EB9, 0xB5, // LATIN SMALL LETTER E WITH DOT BELOW + 0x1EBA, 0x94, // LATIN CAPITAL LETTER E WITH HOOK ABOVE + 0x1EBB, 0xB4, // LATIN SMALL LETTER E WITH HOOK ABOVE + 0x1EBC, 0x93, // LATIN CAPITAL LETTER E WITH TILDE + 0x1EBD, 0xB3, // LATIN SMALL LETTER E WITH TILDE + 0x1EBE, 0x98, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE + 0x1EBF, 0xB8, // LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE + 0x1EC0, 0x97, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE + 0x1EC1, 0xB7, // LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE + 0x1EC2, 0x9A, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE + 0x1EC3, 0xBA, // LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE + 0x1EC4, 0x99, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE + 0x1EC5, 0xB9, // LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE + 0x1EC6, 0x9B, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW + 0x1EC7, 0xBB, // LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW + 0x1EC8, 0x9F, // LATIN CAPITAL LETTER I WITH HOOK ABOVE + 0x1EC9, 0xBF, // LATIN SMALL LETTER I WITH HOOK ABOVE + 0x1ECA, 0xC0, // LATIN CAPITAL LETTER I WITH DOT BELOW + 0x1ECB, 0xE0, // LATIN SMALL LETTER I WITH DOT BELOW + 0x1ECC, 0xC5, // LATIN CAPITAL LETTER O WITH DOT BELOW + 0x1ECD, 0xE5, // LATIN SMALL LETTER O WITH DOT BELOW + 0x1ECE, 0xC4, // LATIN CAPITAL LETTER O WITH HOOK ABOVE + 0x1ECF, 0xE4, // LATIN SMALL LETTER O WITH HOOK ABOVE + 0x1ED0, 0xC8, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE + 0x1ED1, 0xE8, // LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE + 0x1ED2, 0xC7, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE + 0x1ED3, 0xE7, // LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE + 0x1ED4, 0xCA, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE + 0x1ED5, 0xEA, // LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE + 0x1ED6, 0xC9, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE + 0x1ED7, 0xE9, // LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE + 0x1ED8, 0xCB, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW + 0x1ED9, 0xEB, // LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW + 0x1EDA, 0xCE, // LATIN CAPITAL LETTER O WITH HORN AND ACUTE + 0x1EDB, 0xEE, // LATIN SMALL LETTER O WITH HORN AND ACUTE + 0x1EDC, 0xCD, // LATIN CAPITAL LETTER O WITH HORN AND GRAVE + 0x1EDD, 0xED, // LATIN SMALL LETTER O WITH HORN AND GRAVE + 0x1EDE, 0xD0, // LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE + 0x1EDF, 0xF0, // LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE + 0x1EE0, 0xCF, // LATIN CAPITAL LETTER O WITH HORN AND TILDE + 0x1EE1, 0xEF, // LATIN SMALL LETTER O WITH HORN AND TILDE + 0x1EE2, 0xD1, // LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW + 0x1EE3, 0xF1, // LATIN SMALL LETTER O WITH HORN AND DOT BELOW + 0x1EE4, 0xD6, // LATIN CAPITAL LETTER U WITH DOT BELOW + 0x1EE5, 0xF6, // LATIN SMALL LETTER U WITH DOT BELOW + 0x1EE6, 0xD5, // LATIN CAPITAL LETTER U WITH HOOK ABOVE + 0x1EE7, 0xF5, // LATIN SMALL LETTER U WITH HOOK ABOVE + 0x1EE8, 0xD9, // LATIN CAPITAL LETTER U WITH HORN AND ACUTE + 0x1EE9, 0xF9, // LATIN SMALL LETTER U WITH HORN AND ACUTE + 0x1EEA, 0xD8, // LATIN CAPITAL LETTER U WITH HORN AND GRAVE + 0x1EEB, 0xF8, // LATIN SMALL LETTER U WITH HORN AND GRAVE + 0x1EEC, 0xDB, // LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE + 0x1EED, 0xFB, // LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE + 0x1EEE, 0xDA, // LATIN CAPITAL LETTER U WITH HORN AND TILDE + 0x1EEF, 0xFA, // LATIN SMALL LETTER U WITH HORN AND TILDE + 0x1EF0, 0xDC, // LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW + 0x1EF1, 0xFC, // LATIN SMALL LETTER U WITH HORN AND DOT BELOW + 0x1EF2, 0xDD, // LATIN CAPITAL LETTER Y WITH GRAVE + 0x1EF3, 0xFD, // LATIN SMALL LETTER Y WITH GRAVE + 0x1EF4, 0x1C, // LATIN CAPITAL LETTER Y WITH DOT BELOW + 0x1EF5, 0x1D, // LATIN SMALL LETTER Y WITH DOT BELOW + 0x1EF6, 0x1A, // LATIN CAPITAL LETTER Y WITH HOOK ABOVE + 0x1EF7, 0x1B, // LATIN SMALL LETTER Y WITH HOOK ABOVE + 0x1EF8, 0xDF, // LATIN CAPITAL LETTER Y WITH TILDE + 0x1EF9, 0xFF, // LATIN SMALL LETTER Y WITH TILDE + 0x200C, 0x17, + 0x2010, 0x7F, + 0x2013, 0x15, + 0x2014, 0x16, + 0x2018, 0x60, + 0x2019, 0x27, + 0x201A, 0x0D, + 0x201C, 0x10, + 0x201D, 0x11, + 0x201E, 0x12, + 0x2039, 0x0E, + 0x203A, 0x0F, + 0x2423, 0x20, +}; + + +/* UCS -> L7X mapping table */ +static unsigned short UCStoL7Xenc[] = { + /* from, to */ + 0xA0, 0xA0, + 0xA2, 0xA2, + 0xA3, 0xA3, + 0xA4, 0xA4, + 0xA6, 0xA6, + 0xA7, 0xA7, + 0xA8, 0x04, + 0xA9, 0xA9, + 0xAB, 0x13, + 0xAC, 0xAC, + 0xAE, 0xAE, + 0xAF, 0x09, + 0xB0, 0xB0, + 0xB1, 0xB1, + 0xB2, 0xB2, + 0xB3, 0xB3, + 0xB4, 0x01, + 0xB5, 0xB5, + 0xB6, 0xB6, + 0xB7, 0xB7, + 0xB8, 0x0B, + 0xB9, 0xB9, + 0xBB, 0x14, + 0xBC, 0xBC, + 0xBD, 0xBD, + 0xBE, 0xBE, + 0xC4, 0xC4, // LATIN CAPITAL LETTER A WITH DIAERESIS + 0xC5, 0xC5, // LATIN CAPITAL LETTER A WITH RING ABOVE + 0xC6, 0xAF, // LATIN CAPITAL LETTER AE + 0xC9, 0xC9, // LATIN CAPITAL LETTER E WITH ACUTE + 0xD3, 0xD3, // LATIN CAPITAL LETTER O WITH ACUTE + 0xD5, 0xD5, // LATIN CAPITAL LETTER O WITH TILDE + 0xD6, 0xD6, // LATIN CAPITAL LETTER O WITH DIAERESIS + 0xD7, 0xD7, // MULTIPLICATION SIGN + 0xD8, 0xA8, // LATIN CAPITAL LETTER O WITH STROKE + 0xDC, 0xDC, // LATIN CAPITAL LETTER U WITH DIAERESIS + 0xDF, 0xDF, // LATIN SMALL LETTER SHARP S + 0xE4, 0xE4, // LATIN SMALL LETTER A WITH DIAERESIS + 0xE5, 0xE5, // LATIN SMALL LETTER A WITH RING ABOVE + 0xE6, 0xBF, // LATIN SMALL LETTER AE + 0xE9, 0xE9, // LATIN SMALL LETTER E WITH ACUTE + 0xF3, 0xF3, // LATIN SMALL LETTER O WITH ACUTE + 0xF5, 0xF5, // LATIN SMALL LETTER O WITH TILDE + 0xF6, 0xF6, // LATIN SMALL LETTER O WITH DIAERESIS + 0xF7, 0xF7, // DIVISION SIGN + 0xF8, 0xB8, // LATIN SMALL LETTER O WITH STROKE + 0xFC, 0xFC, // LATIN SMALL LETTER U WITH DIAERESIS + 0x100, 0xC2, // LATIN CAPITAL LETTER A WITH MACRON + 0x101, 0xE2, // LATIN SMALL LETTER A WITH MACRON + 0x104, 0xC0, // LATIN CAPITAL LETTER A WITH OGONEK + 0x105, 0xE0, // LATIN SMALL LETTER A WITH OGONEK + 0x106, 0xC3, // LATIN CAPITAL LETTER C WITH ACUTE + 0x107, 0xE3, // LATIN SMALL LETTER C WITH ACUTE + 0x10C, 0xC8, // LATIN CAPITAL LETTER C WITH CARON + 0x10D, 0xE8, // LATIN SMALL LETTER C WITH CARON + 0x112, 0xC7, // LATIN CAPITAL LETTER E WITH MACRON + 0x113, 0xE7, // LATIN SMALL LETTER E WITH MACRON + 0x116, 0xCB, // LATIN CAPITAL LETTER E WITH DOT ABOVE + 0x117, 0xEB, // LATIN SMALL LETTER E WITH DOT ABOVE + 0x118, 0xC6, // LATIN CAPITAL LETTER E WITH OGONEK + 0x119, 0xE6, // LATIN SMALL LETTER E WITH OGONEK + 0x122, 0xCC, // LATIN CAPITAL LETTER G WITH CEDILLA + 0x123, 0xEC, // LATIN SMALL LETTER G WITH CEDILLA + 0x12A, 0xCE, // LATIN CAPITAL LETTER I WITH MACRON + 0x12B, 0xEE, // LATIN SMALL LETTER I WITH MACRON + 0x12E, 0xC1, // LATIN CAPITAL LETTER I WITH OGONEK + 0x12F, 0xE1, // LATIN SMALL LETTER I WITH OGONEK + 0x131, 0x19, // LATIN SMALL LETTER DOTLESS I + 0x136, 0xCD, // LATIN CAPITAL LETTER K WITH CEDILLA + 0x137, 0xED, // LATIN SMALL LETTER K WITH CEDILLA + 0x13B, 0xCF, // LATIN CAPITAL LETTER L WITH CEDILLA + 0x13C, 0xEF, // LATIN SMALL LETTER L WITH CEDILLA + 0x141, 0xD9, // LATIN CAPITAL LETTER L WITH STROKE + 0x142, 0xF9, // LATIN SMALL LETTER L WITH STROKE + 0x143, 0xD1, // LATIN CAPITAL LETTER N WITH ACUTE + 0x144, 0xF1, // LATIN SMALL LETTER N WITH ACUTE + 0x145, 0xD2, // LATIN CAPITAL LETTER N WITH CEDILLA + 0x146, 0xF2, // LATIN SMALL LETTER N WITH CEDILLA + 0x14C, 0xD4, // LATIN CAPITAL LETTER O WITH MACRON + 0x14D, 0xF4, // LATIN SMALL LETTER O WITH MACRON + 0x152, 0x8C, // LATIN CAPITAL LIGATURE OE + 0x153, 0x9C, // LATIN SMALL LIGATURE OE + 0x156, 0xAA, // LATIN CAPITAL LETTER R WITH CEDILLA + 0x157, 0xBA, // LATIN SMALL LETTER R WITH CEDILLA + 0x15A, 0xDA, // LATIN CAPITAL LETTER S WITH ACUTE + 0x15B, 0xFA, // LATIN SMALL LETTER S WITH ACUTE + 0x160, 0xD0, // LATIN CAPITAL LETTER S WITH CARON + 0x161, 0xF0, // LATIN SMALL LETTER S WITH CARON + 0x16A, 0xDB, // LATIN CAPITAL LETTER U WITH MACRON + 0x16B, 0xFB, // LATIN SMALL LETTER U WITH MACRON + 0x172, 0xD8, // LATIN CAPITAL LETTER U WITH OGONEK + 0x173, 0xF8, // LATIN SMALL LETTER U WITH OGONEK + 0x179, 0xCA, // LATIN CAPITAL LETTER Z WITH ACUTE + 0x17A, 0xEA, // LATIN SMALL LETTER Z WITH ACUTE + 0x17B, 0xDD, // LATIN CAPITAL LETTER Z WITH DOT ABOVE + 0x17C, 0xFD, // LATIN SMALL LETTER Z WITH DOT ABOVE + 0x17D, 0xDE, // LATIN CAPITAL LETTER Z WITH CARON + 0x17E, 0xFE, // LATIN SMALL LETTER Z WITH CARON + 0x192, 0x83, // LATIN SMALL LETTER F WITH HOOK + 0x237, 0x1A, // LATIN SMALL LETTER DOTLESS J + 0x2C6, 0x02, + 0x2C7, 0x07, + 0x2D8, 0x08, + 0x2D9, 0x0A, + 0x2DA, 0x06, + 0x2DB, 0x0C, + 0x2DC, 0x03, + 0x2DD, 0x05, + 0x200C, 0x17, + 0x2010, 0xAD, + 0x2013, 0x15, + 0x2014, 0x16, + 0x2018, 0x60, + 0x2019, 0x27, + 0x201A, 0x0D, + 0x201C, 0x10, + 0x201D, 0x11, + 0x201E, 0x12, + 0x2020, 0x86, + 0x2021, 0x87, + 0x2022, 0x95, + 0x2026, 0x85, + 0x2030, 0x89, + 0x2039, 0x0E, + 0x203A, 0x0F, + 0x20AC, 0x80, + 0x2122, 0x99, +}; + +/* UCS -> T2A mapping table */ +static unsigned short UCStoT2Aenc[] = { + /* from, to */ + 0x49, 0x49, // Latin Capital Letter I; glyph for \CYRII, U+0406 І + 0x4A, 0x4A, // Latin Capital Letter J; glyph for \CYRJE, U+0408 Ј + 0x69, 0x69, // Latin Small Letter I; glyph for \cyrii, U+0456 і + 0x6A, 0x6A, // Latin Small Letter J; glyph for \cyrje, U+0458 ј + 0xA4, 0x9E, + 0xA7, 0x9F, + 0xA8, 0x04, + 0xAB, 0xBE, + 0xAF, 0x09, + 0xB4, 0x01, + 0xB8, 0x0B, + 0xBB, 0xBF, + 0x131, 0x19, // LATIN SMALL LETTER DOTLESS I + 0x237, 0x1A, // LATIN SMALL LETTER DOTLESS J + 0x2C6, 0x02, + 0x2C7, 0x07, + 0x2D8, 0x08, + 0x2D9, 0x0A, + 0x2DA, 0x06, + 0x2DB, 0x0C, + 0x2DC, 0x03, + 0x2DD, 0x05, + 0x401, 0x9C, // CYRILLIC CAPITAL LETTER IO + 0x402, 0x82, // CYRILLIC CAPITAL LETTER DJE + 0x404, 0x99, // CYRILLIC CAPITAL LETTER UKRAINIAN IE + 0x405, 0x8F, // CYRILLIC CAPITAL LETTER DZE + 0x406, 0x49, // CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I; \CYRII + 0x407, 0x88, // CYRILLIC CAPITAL LETTER YI + 0x408, 0x4A, // CYRILLIC CAPITAL LETTER JE ; \CYRJE + 0x409, 0x87, // CYRILLIC CAPITAL LETTER LJE + 0x40A, 0x9B, // CYRILLIC CAPITAL LETTER NJE + 0x40B, 0x83, // CYRILLIC CAPITAL LETTER TSHE + 0x40E, 0x92, // CYRILLIC CAPITAL LETTER SHORT U + 0x40F, 0x96, // CYRILLIC CAPITAL LETTER DZHE + 0x410, 0xC0, // CYRILLIC CAPITAL LETTER A + 0x411, 0xC1, // CYRILLIC CAPITAL LETTER BE + 0x412, 0xC2, // CYRILLIC CAPITAL LETTER VE + 0x413, 0xC3, // CYRILLIC CAPITAL LETTER GHE + 0x414, 0xC4, // CYRILLIC CAPITAL LETTER DE + 0x415, 0xC5, // CYRILLIC CAPITAL LETTER IE + 0x416, 0xC6, // CYRILLIC CAPITAL LETTER ZHE + 0x417, 0xC7, // CYRILLIC CAPITAL LETTER ZE + 0x418, 0xC8, // CYRILLIC CAPITAL LETTER I + 0x419, 0xC9, // CYRILLIC CAPITAL LETTER SHORT I + 0x41A, 0xCA, // CYRILLIC CAPITAL LETTER KA + 0x41B, 0xCB, // CYRILLIC CAPITAL LETTER EL + 0x41C, 0xCC, // CYRILLIC CAPITAL LETTER EM + 0x41D, 0xCD, // CYRILLIC CAPITAL LETTER EN + 0x41E, 0xCE, // CYRILLIC CAPITAL LETTER O + 0x41F, 0xCF, // CYRILLIC CAPITAL LETTER PE + 0x420, 0xD0, // CYRILLIC CAPITAL LETTER ER + 0x421, 0xD1, // CYRILLIC CAPITAL LETTER ES + 0x422, 0xD2, // CYRILLIC CAPITAL LETTER TE + 0x423, 0xD3, // CYRILLIC CAPITAL LETTER U + 0x424, 0xD4, // CYRILLIC CAPITAL LETTER EF + 0x425, 0xD5, // CYRILLIC CAPITAL LETTER HA + 0x426, 0xD6, // CYRILLIC CAPITAL LETTER TSE + 0x427, 0xD7, // CYRILLIC CAPITAL LETTER CHE + 0x428, 0xD8, // CYRILLIC CAPITAL LETTER SHA + 0x429, 0xD9, // CYRILLIC CAPITAL LETTER SHCHA + 0x42A, 0xDA, // CYRILLIC CAPITAL LETTER HARD SIGN + 0x42B, 0xDB, // CYRILLIC CAPITAL LETTER YERU + 0x42C, 0xDC, // CYRILLIC CAPITAL LETTER SOFT SIGN + 0x42D, 0xDD, // CYRILLIC CAPITAL LETTER E + 0x42E, 0xDE, // CYRILLIC CAPITAL LETTER YU + 0x42F, 0xDF, // CYRILLIC CAPITAL LETTER YA + 0x430, 0xE0, // CYRILLIC SMALL LETTER A + 0x431, 0xE1, // CYRILLIC SMALL LETTER BE + 0x432, 0xE2, // CYRILLIC SMALL LETTER VE + 0x433, 0xE3, // CYRILLIC SMALL LETTER GHE + 0x434, 0xE4, // CYRILLIC SMALL LETTER DE + 0x435, 0xE5, // CYRILLIC SMALL LETTER IE + 0x436, 0xE6, // CYRILLIC SMALL LETTER ZHE + 0x437, 0xE7, // CYRILLIC SMALL LETTER ZE + 0x438, 0xE8, // CYRILLIC SMALL LETTER I + 0x439, 0xE9, // CYRILLIC SMALL LETTER SHORT I + 0x43A, 0xEA, // CYRILLIC SMALL LETTER KA + 0x43B, 0xEB, // CYRILLIC SMALL LETTER EL + 0x43C, 0xEC, // CYRILLIC SMALL LETTER EM + 0x43D, 0xED, // CYRILLIC SMALL LETTER EN + 0x43E, 0xEE, // CYRILLIC SMALL LETTER O + 0x43F, 0xEF, // CYRILLIC SMALL LETTER PE + 0x440, 0xF0, // CYRILLIC SMALL LETTER ER + 0x441, 0xF1, // CYRILLIC SMALL LETTER ES + 0x442, 0xF2, // CYRILLIC SMALL LETTER TE + 0x443, 0xF3, // CYRILLIC SMALL LETTER U + 0x444, 0xF4, // CYRILLIC SMALL LETTER EF + 0x445, 0xF5, // CYRILLIC SMALL LETTER HA + 0x446, 0xF6, // CYRILLIC SMALL LETTER TSE + 0x447, 0xF7, // CYRILLIC SMALL LETTER CHE + 0x448, 0xF8, // CYRILLIC SMALL LETTER SHA + 0x449, 0xF9, // CYRILLIC SMALL LETTER SHCHA + 0x44A, 0xFA, // CYRILLIC SMALL LETTER HARD SIGN + 0x44B, 0xFB, // CYRILLIC SMALL LETTER YERU + 0x44C, 0xFC, // CYRILLIC SMALL LETTER SOFT SIGN + 0x44D, 0xFD, // CYRILLIC SMALL LETTER E + 0x44E, 0xFE, // CYRILLIC SMALL LETTER YU + 0x44F, 0xFF, // CYRILLIC SMALL LETTER YA + 0x451, 0xBC, // CYRILLIC SMALL LETTER IO + 0x452, 0xA2, // CYRILLIC SMALL LETTER DJE + 0x454, 0xB9, // CYRILLIC SMALL LETTER UKRAINIAN IE + 0x455, 0xAF, // CYRILLIC SMALL LETTER DZE + 0x456, 0x69, // CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I; \cyrii + 0x457, 0xA8, // CYRILLIC SMALL LETTER YI + 0x458, 0x6A, // CYRILLIC SMALL LETTER JE; \cyrje + 0x459, 0xA7, // CYRILLIC SMALL LETTER LJE + 0x45A, 0xBB, // CYRILLIC SMALL LETTER NJE + 0x45B, 0xA3, // CYRILLIC SMALL LETTER TSHE + 0x45E, 0xB2, // CYRILLIC SMALL LETTER SHORT U + 0x45F, 0xB6, // CYRILLIC SMALL LETTER DZHE + 0x490, 0x80, // CYRILLIC CAPITAL LETTER GHE WITH UPTURN + 0x491, 0xA0, // CYRILLIC SMALL LETTER GHE WITH UPTURN + 0x492, 0x81, // CYRILLIC CAPITAL LETTER GHE WITH STROKE + 0x493, 0xA1, // CYRILLIC SMALL LETTER GHE WITH STROKE + 0x496, 0x85, // CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER + 0x497, 0xA5, // CYRILLIC SMALL LETTER ZHE WITH DESCENDER + 0x498, 0x86, // CYRILLIC CAPITAL LETTER ZE WITH DESCENDER + 0x499, 0xA6, // CYRILLIC SMALL LETTER ZE WITH DESCENDER + 0x49A, 0x89, // CYRILLIC CAPITAL LETTER KA WITH DESCENDER + 0x49B, 0xA9, // CYRILLIC SMALL LETTER KA WITH DESCENDER + 0x49C, 0x8B, // CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE + 0x49D, 0xAB, // CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE + 0x4A0, 0x8A, // CYRILLIC CAPITAL LETTER BASHKIR KA + 0x4A1, 0xAA, // CYRILLIC SMALL LETTER BASHKIR KA + 0x4A2, 0x8D, // CYRILLIC CAPITAL LETTER EN WITH DESCENDER + 0x4A3, 0xAD, // CYRILLIC SMALL LETTER EN WITH DESCENDER + 0x4A4, 0x8E, // CYRILLIC CAPITAL LIGATURE EN GHE + 0x4A5, 0xAE, // CYRILLIC SMALL LIGATURE EN GHE + 0x4AA, 0x91, // CYRILLIC CAPITAL LETTER ES WITH DESCENDER + 0x4AB, 0xB1, // CYRILLIC SMALL LETTER ES WITH DESCENDER + 0x4AE, 0x93, // CYRILLIC CAPITAL LETTER STRAIGHT U + 0x4AF, 0xB3, // CYRILLIC SMALL LETTER STRAIGHT U + 0x4B0, 0x94, // CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE + 0x4B1, 0xB4, // CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE + 0x4B2, 0x95, // CYRILLIC CAPITAL LETTER HA WITH DESCENDER + 0x4B3, 0xB5, // CYRILLIC SMALL LETTER HA WITH DESCENDER + 0x4B6, 0x98, // CYRILLIC CAPITAL LETTER CHE WITH DESCENDER + 0x4B7, 0xB8, // CYRILLIC SMALL LETTER CHE WITH DESCENDER + 0x4B8, 0x97, // CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE + 0x4B9, 0xB7, // CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE + 0x4BA, 0x84, // CYRILLIC CAPITAL LETTER SHHA + 0x4BB, 0xA4, // CYRILLIC SMALL LETTER SHHA + 0x4C0, 0x0D, // CYRILLIC LETTER PALOCHKA + 0x4D4, 0x8C, // CYRILLIC CAPITAL LIGATURE A IE + 0x4D5, 0xAC, // CYRILLIC SMALL LIGATURE A IE + 0x4D8, 0x9A, // CYRILLIC CAPITAL LETTER SCHWA + 0x4D9, 0xBA, // CYRILLIC SMALL LETTER SCHWA + 0x4E8, 0x90, // CYRILLIC CAPITAL LETTER BARRED O + 0x4E9, 0xB0, // CYRILLIC SMALL LETTER BARRED O + 0x200C, 0x17, + 0x2010, 0x7F, + 0x2013, 0x15, + 0x2014, 0x16, + 0x2018, 0x60, + 0x2019, 0x27, + 0x201C, 0x10, + 0x201D, 0x11, + 0x201E, 0xBD, + 0x2116, 0x9D, + 0x2329, 0x0E, + 0x232A, 0x0F, + 0x2423, 0x20, +}; + +/* UCS -> T2B mapping table */ +static unsigned short UCStoT2Benc[] = { + /* from, to */ + 0x49, 0x49, // Latin Capital Letter I; glyph for \CYRII, U+0406 І + 0x4A, 0x4A, // Latin Capital Letter J; glyph for \CYRJE, U+0408 Ј + 0x69, 0x69, // Latin Small Letter I; glyph for \cyrii, U+0456 і + 0x6A, 0x6A, // Latin Small Letter J; glyph for \cyrje, U+0458 ј + 0xA4, 0x9E, + 0xA7, 0x9F, + 0xA8, 0x04, + 0xAB, 0xBE, + 0xAF, 0x09, + 0xB4, 0x01, + 0xB8, 0x0B, + 0xBB, 0xBF, + 0x131, 0x19, // LATIN SMALL LETTER DOTLESS I + 0x237, 0x1A, // LATIN SMALL LETTER DOTLESS J + 0x2C6, 0x02, + 0x2C7, 0x07, + 0x2D8, 0x08, + 0x2D9, 0x0A, + 0x2DA, 0x06, + 0x2DB, 0x0C, + 0x2DC, 0x03, + 0x2DD, 0x05, + 0x401, 0x9C, // CYRILLIC CAPITAL LETTER IO + 0x406, 0x49, // CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I; \CYRII + 0x408, 0x4A, // CYRILLIC CAPITAL LETTER JE ; \CYRJE + 0x409, 0x88, // CYRILLIC CAPITAL LETTER LJE + 0x40A, 0x99, // CYRILLIC CAPITAL LETTER NJE + 0x40E, 0x92, // CYRILLIC CAPITAL LETTER SHORT U + 0x410, 0xC0, // CYRILLIC CAPITAL LETTER A + 0x411, 0xC1, // CYRILLIC CAPITAL LETTER BE + 0x412, 0xC2, // CYRILLIC CAPITAL LETTER VE + 0x413, 0xC3, // CYRILLIC CAPITAL LETTER GHE + 0x414, 0xC4, // CYRILLIC CAPITAL LETTER DE + 0x415, 0xC5, // CYRILLIC CAPITAL LETTER IE + 0x416, 0xC6, // CYRILLIC CAPITAL LETTER ZHE + 0x417, 0xC7, // CYRILLIC CAPITAL LETTER ZE + 0x418, 0xC8, // CYRILLIC CAPITAL LETTER I + 0x419, 0xC9, // CYRILLIC CAPITAL LETTER SHORT I + 0x41A, 0xCA, // CYRILLIC CAPITAL LETTER KA + 0x41B, 0xCB, // CYRILLIC CAPITAL LETTER EL + 0x41C, 0xCC, // CYRILLIC CAPITAL LETTER EM + 0x41D, 0xCD, // CYRILLIC CAPITAL LETTER EN + 0x41E, 0xCE, // CYRILLIC CAPITAL LETTER O + 0x41F, 0xCF, // CYRILLIC CAPITAL LETTER PE + 0x420, 0xD0, // CYRILLIC CAPITAL LETTER ER + 0x421, 0xD1, // CYRILLIC CAPITAL LETTER ES + 0x422, 0xD2, // CYRILLIC CAPITAL LETTER TE + 0x423, 0xD3, // CYRILLIC CAPITAL LETTER U + 0x424, 0xD4, // CYRILLIC CAPITAL LETTER EF + 0x425, 0xD5, // CYRILLIC CAPITAL LETTER HA + 0x426, 0xD6, // CYRILLIC CAPITAL LETTER TSE + 0x427, 0xD7, // CYRILLIC CAPITAL LETTER CHE + 0x428, 0xD8, // CYRILLIC CAPITAL LETTER SHA + 0x429, 0xD9, // CYRILLIC CAPITAL LETTER SHCHA + 0x42A, 0xDA, // CYRILLIC CAPITAL LETTER HARD SIGN + 0x42B, 0xDB, // CYRILLIC CAPITAL LETTER YERU + 0x42C, 0xDC, // CYRILLIC CAPITAL LETTER SOFT SIGN + 0x42D, 0xDD, // CYRILLIC CAPITAL LETTER E + 0x42E, 0xDE, // CYRILLIC CAPITAL LETTER YU + 0x42F, 0xDF, // CYRILLIC CAPITAL LETTER YA + 0x430, 0xE0, // CYRILLIC SMALL LETTER A + 0x431, 0xE1, // CYRILLIC SMALL LETTER BE + 0x432, 0xE2, // CYRILLIC SMALL LETTER VE + 0x433, 0xE3, // CYRILLIC SMALL LETTER GHE + 0x434, 0xE4, // CYRILLIC SMALL LETTER DE + 0x435, 0xE5, // CYRILLIC SMALL LETTER IE + 0x436, 0xE6, // CYRILLIC SMALL LETTER ZHE + 0x437, 0xE7, // CYRILLIC SMALL LETTER ZE + 0x438, 0xE8, // CYRILLIC SMALL LETTER I + 0x439, 0xE9, // CYRILLIC SMALL LETTER SHORT I + 0x43A, 0xEA, // CYRILLIC SMALL LETTER KA + 0x43B, 0xEB, // CYRILLIC SMALL LETTER EL + 0x43C, 0xEC, // CYRILLIC SMALL LETTER EM + 0x43D, 0xED, // CYRILLIC SMALL LETTER EN + 0x43E, 0xEE, // CYRILLIC SMALL LETTER O + 0x43F, 0xEF, // CYRILLIC SMALL LETTER PE + 0x440, 0xF0, // CYRILLIC SMALL LETTER ER + 0x441, 0xF1, // CYRILLIC SMALL LETTER ES + 0x442, 0xF2, // CYRILLIC SMALL LETTER TE + 0x443, 0xF3, // CYRILLIC SMALL LETTER U + 0x444, 0xF4, // CYRILLIC SMALL LETTER EF + 0x445, 0xF5, // CYRILLIC SMALL LETTER HA + 0x446, 0xF6, // CYRILLIC SMALL LETTER TSE + 0x447, 0xF7, // CYRILLIC SMALL LETTER CHE + 0x448, 0xF8, // CYRILLIC SMALL LETTER SHA + 0x449, 0xF9, // CYRILLIC SMALL LETTER SHCHA + 0x44A, 0xFA, // CYRILLIC SMALL LETTER HARD SIGN + 0x44B, 0xFB, // CYRILLIC SMALL LETTER YERU + 0x44C, 0xFC, // CYRILLIC SMALL LETTER SOFT SIGN + 0x44D, 0xFD, // CYRILLIC SMALL LETTER E + 0x44E, 0xFE, // CYRILLIC SMALL LETTER YU + 0x44F, 0xFF, // CYRILLIC SMALL LETTER YA + 0x451, 0xBC, // CYRILLIC SMALL LETTER IO + 0x456, 0x69, // CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I; \cyrii + 0x458, 0x6A, // CYRILLIC SMALL LETTER JE; \cyrje + 0x459, 0xA8, // CYRILLIC SMALL LETTER LJE + 0x45A, 0xB9, // CYRILLIC SMALL LETTER NJE + 0x45E, 0xB2, // CYRILLIC SMALL LETTER SHORT U + 0x492, 0x81, // CYRILLIC CAPITAL LETTER GHE WITH STROKE + 0x493, 0xA1, // CYRILLIC SMALL LETTER GHE WITH STROKE + 0x494, 0x83, // CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK + 0x495, 0xA3, // CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK + 0x496, 0x85, // CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER + 0x497, 0xA5, // CYRILLIC SMALL LETTER ZHE WITH DESCENDER + 0x49A, 0x89, // CYRILLIC CAPITAL LETTER KA WITH DESCENDER + 0x49B, 0xA9, // CYRILLIC SMALL LETTER KA WITH DESCENDER + 0x4A2, 0x8D, // CYRILLIC CAPITAL LETTER EN WITH DESCENDER + 0x4A3, 0xAD, // CYRILLIC SMALL LETTER EN WITH DESCENDER + 0x4A4, 0x8E, // CYRILLIC CAPITAL LIGATURE EN GHE + 0x4A5, 0xAE, // CYRILLIC SMALL LIGATURE EN GHE + 0x4AE, 0x93, // CYRILLIC CAPITAL LETTER STRAIGHT U + 0x4AF, 0xB3, // CYRILLIC SMALL LETTER STRAIGHT U + 0x4B2, 0x95, // CYRILLIC CAPITAL LETTER HA WITH DESCENDER + 0x4B3, 0xB5, // CYRILLIC SMALL LETTER HA WITH DESCENDER + 0x4B6, 0x98, // CYRILLIC CAPITAL LETTER CHE WITH DESCENDER + 0x4B7, 0xB8, // CYRILLIC SMALL LETTER CHE WITH DESCENDER + 0x4BA, 0x84, // CYRILLIC CAPITAL LETTER SHHA + 0x4BB, 0xA4, // CYRILLIC SMALL LETTER SHHA + 0x4C0, 0x0D, // CYRILLIC LETTER PALOCHKA + 0x4C3, 0x8B, // CYRILLIC CAPITAL LETTER KA WITH HOOK + 0x4C4, 0xAB, // CYRILLIC SMALL LETTER KA WITH HOOK + 0x4C5, 0x8A, // CYRILLIC CAPITAL LETTER EL WITH TAIL + 0x4C6, 0xAA, // CYRILLIC SMALL LETTER EL WITH TAIL + 0x4C7, 0x8F, // CYRILLIC CAPITAL LETTER EN WITH HOOK + 0x4C8, 0xAF, // CYRILLIC SMALL LETTER EN WITH HOOK + 0x4CB, 0x97, // CYRILLIC CAPITAL LETTER KHAKASSIAN CHE + 0x4CC, 0xB7, // CYRILLIC SMALL LETTER KHAKASSIAN CHE + 0x4D8, 0x9A, // CYRILLIC CAPITAL LETTER SCHWA + 0x4D9, 0xBA, // CYRILLIC SMALL LETTER SCHWA + 0x4E0, 0x87, // CYRILLIC CAPITAL LETTER ABKHASIAN DZE + 0x4E1, 0xA7, // CYRILLIC SMALL LETTER ABKHASIAN DZE + 0x4E8, 0x90, // CYRILLIC CAPITAL LETTER BARRED O + 0x4E9, 0xB0, // CYRILLIC SMALL LETTER BARRED O + 0x4F6, 0x82, // CYRILLIC CAPITAL LETTER GHE WITH DESCENDER + 0x4F7, 0xA2, // CYRILLIC SMALL LETTER GHE WITH DESCENDER + 0x4FA, 0x80, // CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK + 0x4FB, 0xA0, // CYRILLIC SMALL LETTER GHE WITH STROKE AND HOOK + 0x4FC, 0x96, // CYRILLIC CAPITAL LETTER HA WITH HOOK + 0x4FD, 0xB6, // CYRILLIC SMALL LETTER HA WITH HOOK + 0x4FE, 0x94, // CYRILLIC CAPITAL LETTER HA WITH STROKE + 0x4FF, 0xB4, // CYRILLIC SMALL LETTER HA WITH STROKE + 0x510, 0x9B, // CYRILLIC CAPITAL LETTER REVERSED ZE + 0x511, 0xBB, // CYRILLIC SMALL LETTER REVERSED ZE + 0x512, 0x8C, // CYRILLIC CAPITAL LETTER EL WITH HOOK + 0x513, 0xAC, // CYRILLIC SMALL LETTER EL WITH HOOK + 0x200C, 0x17, + 0x2010, 0x7F, + 0x2013, 0x15, + 0x2014, 0x16, + 0x2018, 0x60, + 0x2019, 0x27, + 0x201C, 0x10, + 0x201D, 0x11, + 0x201E, 0xBD, + 0x2116, 0x9D, + 0x2329, 0x0E, + 0x232A, 0x0F, + 0x2423, 0x20, +}; + +/* UCS -> T2C mapping table */ +static unsigned short UCStoT2Cenc[] = { + /* from, to */ + 0x49, 0x49, // Latin Capital Letter I; glyph for \CYRII, U+0406 І + 0x4A, 0x4A, // Latin Capital Letter J; glyph for \CYRJE, U+0408 Ј + 0x69, 0x69, // Latin Small Letter I; glyph for \cyrii, U+0456 і + 0x6A, 0x6A, // Latin Small Letter J; glyph for \cyrje, U+0458 ј + 0xA4, 0x9E, + 0xA7, 0x9F, + 0xA8, 0x04, + 0xAB, 0xBE, + 0xAF, 0x09, + 0xB4, 0x01, + 0xB8, 0x0B, + 0xBB, 0xBF, + 0x131, 0x19, // LATIN SMALL LETTER DOTLESS I + 0x237, 0x1A, // LATIN SMALL LETTER DOTLESS J + 0x2C6, 0x02, + 0x2C7, 0x07, + 0x2D8, 0x08, + 0x2D9, 0x0A, + 0x2DA, 0x06, + 0x2DB, 0x0C, + 0x2DC, 0x03, + 0x2DD, 0x05, + 0x401, 0x9C, // CYRILLIC CAPITAL LETTER IO + 0x406, 0x49, // CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I; \CYRII + 0x408, 0x4A, // CYRILLIC CAPITAL LETTER JE ; \CYRJE + 0x40F, 0x96, // CYRILLIC CAPITAL LETTER DZHE + 0x410, 0xC0, // CYRILLIC CAPITAL LETTER A + 0x411, 0xC1, // CYRILLIC CAPITAL LETTER BE + 0x412, 0xC2, // CYRILLIC CAPITAL LETTER VE + 0x413, 0xC3, // CYRILLIC CAPITAL LETTER GHE + 0x414, 0xC4, // CYRILLIC CAPITAL LETTER DE + 0x415, 0xC5, // CYRILLIC CAPITAL LETTER IE + 0x416, 0xC6, // CYRILLIC CAPITAL LETTER ZHE + 0x417, 0xC7, // CYRILLIC CAPITAL LETTER ZE + 0x418, 0xC8, // CYRILLIC CAPITAL LETTER I + 0x419, 0xC9, // CYRILLIC CAPITAL LETTER SHORT I + 0x41A, 0xCA, // CYRILLIC CAPITAL LETTER KA + 0x41B, 0xCB, // CYRILLIC CAPITAL LETTER EL + 0x41C, 0xCC, // CYRILLIC CAPITAL LETTER EM + 0x41D, 0xCD, // CYRILLIC CAPITAL LETTER EN + 0x41E, 0xCE, // CYRILLIC CAPITAL LETTER O + 0x41F, 0xCF, // CYRILLIC CAPITAL LETTER PE + 0x420, 0xD0, // CYRILLIC CAPITAL LETTER ER + 0x421, 0xD1, // CYRILLIC CAPITAL LETTER ES + 0x422, 0xD2, // CYRILLIC CAPITAL LETTER TE + 0x423, 0xD3, // CYRILLIC CAPITAL LETTER U + 0x424, 0xD4, // CYRILLIC CAPITAL LETTER EF + 0x425, 0xD5, // CYRILLIC CAPITAL LETTER HA + 0x426, 0xD6, // CYRILLIC CAPITAL LETTER TSE + 0x427, 0xD7, // CYRILLIC CAPITAL LETTER CHE + 0x428, 0xD8, // CYRILLIC CAPITAL LETTER SHA + 0x429, 0xD9, // CYRILLIC CAPITAL LETTER SHCHA + 0x42A, 0xDA, // CYRILLIC CAPITAL LETTER HARD SIGN + 0x42B, 0xDB, // CYRILLIC CAPITAL LETTER YERU + 0x42C, 0xDC, // CYRILLIC CAPITAL LETTER SOFT SIGN + 0x42D, 0xDD, // CYRILLIC CAPITAL LETTER E + 0x42E, 0xDE, // CYRILLIC CAPITAL LETTER YU + 0x42F, 0xDF, // CYRILLIC CAPITAL LETTER YA + 0x430, 0xE0, // CYRILLIC SMALL LETTER A + 0x431, 0xE1, // CYRILLIC SMALL LETTER BE + 0x432, 0xE2, // CYRILLIC SMALL LETTER VE + 0x433, 0xE3, // CYRILLIC SMALL LETTER GHE + 0x434, 0xE4, // CYRILLIC SMALL LETTER DE + 0x435, 0xE5, // CYRILLIC SMALL LETTER IE + 0x436, 0xE6, // CYRILLIC SMALL LETTER ZHE + 0x437, 0xE7, // CYRILLIC SMALL LETTER ZE + 0x438, 0xE8, // CYRILLIC SMALL LETTER I + 0x439, 0xE9, // CYRILLIC SMALL LETTER SHORT I + 0x43A, 0xEA, // CYRILLIC SMALL LETTER KA + 0x43B, 0xEB, // CYRILLIC SMALL LETTER EL + 0x43C, 0xEC, // CYRILLIC SMALL LETTER EM + 0x43D, 0xED, // CYRILLIC SMALL LETTER EN + 0x43E, 0xEE, // CYRILLIC SMALL LETTER O + 0x43F, 0xEF, // CYRILLIC SMALL LETTER PE + 0x440, 0xF0, // CYRILLIC SMALL LETTER ER + 0x441, 0xF1, // CYRILLIC SMALL LETTER ES + 0x442, 0xF2, // CYRILLIC SMALL LETTER TE + 0x443, 0xF3, // CYRILLIC SMALL LETTER U + 0x444, 0xF4, // CYRILLIC SMALL LETTER EF + 0x445, 0xF5, // CYRILLIC SMALL LETTER HA + 0x446, 0xF6, // CYRILLIC SMALL LETTER TSE + 0x447, 0xF7, // CYRILLIC SMALL LETTER CHE + 0x448, 0xF8, // CYRILLIC SMALL LETTER SHA + 0x449, 0xF9, // CYRILLIC SMALL LETTER SHCHA + 0x44A, 0xFA, // CYRILLIC SMALL LETTER HARD SIGN + 0x44B, 0xFB, // CYRILLIC SMALL LETTER YERU + 0x44C, 0xFC, // CYRILLIC SMALL LETTER SOFT SIGN + 0x44D, 0xFD, // CYRILLIC SMALL LETTER E + 0x44E, 0xFE, // CYRILLIC SMALL LETTER YU + 0x44F, 0xFF, // CYRILLIC SMALL LETTER YA + 0x451, 0xBC, // CYRILLIC SMALL LETTER IO + 0x456, 0x69, // CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I; \cyrii + 0x458, 0x6A, // CYRILLIC SMALL LETTER JE; \cyrje + 0x45F, 0xB6, // CYRILLIC SMALL LETTER DZHE + 0x48A, 0x94, // CYRILLIC CAPITAL LETTER SHORT I WITH TAIL + 0x48B, 0xB4, // CYRILLIC SMALL LETTER SHORT I WITH TAIL + 0x48C, 0x93, // CYRILLIC CAPITAL LETTER SEMISOFT SIGN + 0x48D, 0xB3, // CYRILLIC SMALL LETTER SEMISOFT SIGN + 0x48E, 0x86, // CYRILLIC CAPITAL LETTER ER WITH TICK + 0x48F, 0xA6, // CYRILLIC SMALL LETTER ER WITH TICK + 0x494, 0x83, // CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK + 0x495, 0xA3, // CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK + 0x49A, 0x89, // CYRILLIC CAPITAL LETTER KA WITH DESCENDER + 0x49B, 0xA9, // CYRILLIC SMALL LETTER KA WITH DESCENDER + 0x49E, 0x8B, // CYRILLIC CAPITAL LETTER KA WITH STROKE + 0x49F, 0xAB, // CYRILLIC SMALL LETTER KA WITH STROKE + 0x4A2, 0x8D, // CYRILLIC CAPITAL LETTER EN WITH DESCENDER + 0x4A3, 0xAD, // CYRILLIC SMALL LETTER EN WITH DESCENDER + 0x4A6, 0x80, // CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK + 0x4A7, 0xA0, // CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK + 0x4A8, 0x97, // CYRILLIC CAPITAL LETTER ABKHASIAN HA + 0x4A9, 0xB7, // CYRILLIC SMALL LETTER ABKHASIAN HA + 0x4AC, 0x82, // CYRILLIC CAPITAL LETTER TE WITH DESCENDER + 0x4AD, 0xA2, // CYRILLIC SMALL LETTER TE WITH DESCENDER + 0x4B2, 0x95, // CYRILLIC CAPITAL LETTER HA WITH DESCENDER + 0x4B3, 0xB5, // CYRILLIC SMALL LETTER HA WITH DESCENDER + 0x4B4, 0x81, // CYRILLIC CAPITAL LIGATURE TE TSE + 0x4B5, 0xA1, // CYRILLIC SMALL LIGATURE TE TSE + 0x4B6, 0x98, // CYRILLIC CAPITAL LETTER CHE WITH DESCENDER + 0x4B7, 0xB8, // CYRILLIC SMALL LETTER CHE WITH DESCENDER + 0x4BA, 0x84, // CYRILLIC CAPITAL LETTER SHHA + 0x4BB, 0xA4, // CYRILLIC SMALL LETTER SHHA + 0x4BC, 0x91, // CYRILLIC CAPITAL LETTER ABKHASIAN CHE + 0x4BD, 0xB1, // CYRILLIC SMALL LETTER ABKHASIAN CHE + 0x4BE, 0x92, // CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER + 0x4BF, 0xB2, // CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER + 0x4C0, 0x0D, // CYRILLIC LETTER PALOCHKA + 0x4C5, 0x8A, // CYRILLIC CAPITAL LETTER EL WITH TAIL + 0x4C6, 0xAA, // CYRILLIC SMALL LETTER EL WITH TAIL + 0x4C7, 0x8F, // CYRILLIC CAPITAL LETTER EN WITH HOOK + 0x4C8, 0xAF, // CYRILLIC SMALL LETTER EN WITH HOOK + 0x4CD, 0x88, // CYRILLIC CAPITAL LETTER EM WITH TAIL + 0x4CE, 0xA8, // CYRILLIC SMALL LETTER EM WITH TAIL + 0x4D8, 0x9A, // CYRILLIC CAPITAL LETTER SCHWA + 0x4D9, 0xBA, // CYRILLIC SMALL LETTER SCHWA + 0x4E0, 0x87, // CYRILLIC CAPITAL LETTER ABKHASIAN DZE + 0x4E1, 0xA7, // CYRILLIC SMALL LETTER ABKHASIAN DZE + 0x4E8, 0x90, // CYRILLIC CAPITAL LETTER BARRED O + 0x4E9, 0xB0, // CYRILLIC SMALL LETTER BARRED O + 0x512, 0x8C, // CYRILLIC CAPITAL LETTER EL WITH HOOK + 0x513, 0xAC, // CYRILLIC SMALL LETTER EL WITH HOOK + 0x528, 0x99, // CYRILLIC CAPITAL LETTER EN WITH LEFT HOOK + 0x529, 0xB9, // CYRILLIC SMALL LETTER EN WITH LEFT HOOK + 0x200C, 0x17, + 0x2010, 0x7F, + 0x2013, 0x15, + 0x2014, 0x16, + 0x2018, 0x60, + 0x2019, 0x27, + 0x201C, 0x10, + 0x201D, 0x11, + 0x201E, 0xBD, + 0x2116, 0x9D, + 0x2329, 0x0E, + 0x232A, 0x0F, + 0x2423, 0x20, +}; + +/* UCS -> LGR mapping table */ +static unsigned short UCStoLGRenc[] = { + /* from, to */ + 0xAB, 0x7B, + 0xBB, 0x7D, + 0x259, 0x1A, // Latin Small Letter Schwa + 0x374, 0xFE, // Greek Numeral Sign + 0x375, 0xFF, // Greek Lower Numeral Sign + 0x37A, 0x7C, // Greek Ypogegrammeni + 0x37E, 0x3F, // Greek Question Mark + 0x384, 0x27, // Greek Tonos + 0x386, 0xFD, // Greek Capital Letter Alpha with Tonos + 0x387, 0x26, // Greek Ano Teleia + 0x388, 0xC7, // Greek Capital Letter Epsilon with Tonos + 0x389, 0x9F, // Greek Capital Letter Eta with Tonos + 0x38A, 0x9B, // Greek Capital Letter Iota with Tonos + 0x38C, 0x97, // Greek Capital Letter Omicron with Tonos + 0x390, 0xF2, // Greek Small Letter Iota with Dialytika and Tonos + + 0x391, 0x0C, // Greek Capital Letter Alpha +// 0x391, 0x41, // Greek Capital Letter Alpha + 0x392, 0x42, // Greek Capital Letter Beta + 0x393, 0x47, // Greek Capital Letter Gamma + 0x394, 0x44, // Greek Capital Letter Delta + 0x395, 0x45, // Greek Capital Letter Epsilon + 0x396, 0x5A, // Greek Capital Letter Zeta + 0x397, 0x48, // Greek Capital Letter Eta + 0x398, 0x4A, // Greek Capital Letter Theta + 0x399, 0x49, // Greek Capital Letter Iota + 0x39A, 0x4B, // Greek Capital Letter Kappa + 0x39B, 0x4C, // Greek Capital Letter Lamda + 0x39C, 0x4D, // Greek Capital Letter Mu + 0x39D, 0x4E, // Greek Capital Letter Nu + 0x39E, 0x58, // Greek Capital Letter Xi + 0x39F, 0x4F, // Greek Capital Letter Omicron + 0x3A0, 0x50, // Greek Capital Letter Pi + 0x3A1, 0x52, // Greek Capital Letter Rho + 0x3A3, 0x53, // Greek Capital Letter Sigma + 0x3A4, 0x54, // Greek Capital Letter Tau + 0x3A5, 0x55, // Greek Capital Letter Upsilon + 0x3A6, 0x46, // Greek Capital Letter Phi + 0x3A7, 0x51, // Greek Capital Letter Chi + 0x3A8, 0x59, // Greek Capital Letter Psi + 0x3A9, 0x57, // Greek Capital Letter Omega + + 0x3AA, 0xDB, // Greek Capital Letter Iota with Dialytika +// 0x3AB, 0x13, // Greek Capital Letter Upsilon with Dialytika + 0x3AB, 0xDF, // Greek Capital Letter Upsilon with Dialytika + 0x3AC, 0x88, // Greek Small Letter Alpha with Tonos + 0x3AD, 0xE8, // Greek Small Letter Epsilon with Tonos + 0x3AE, 0xA0, // Greek Small Letter Eta with Tonos + 0x3AF, 0xD0, // Greek Small Letter Iota with Tonos + 0x3B0, 0xF6, // Greek Small Letter Upsilon with Dialytika and Tonos + + 0x3B1, 0x0E, // Greek Small Letter Alpha +// 0x3B1, 0x61, // Greek Small Letter Alpha + 0x3B2, 0x62, // Greek Small Letter Beta + 0x3B3, 0x67, // Greek Small Letter Gamma + 0x3B4, 0x64, // Greek Small Letter Delta + 0x3B5, 0x65, // Greek Small Letter Epsilon + 0x3B6, 0x7A, // Greek Small Letter Zeta + 0x3B7, 0x68, // Greek Small Letter Eta + 0x3B8, 0x6A, // Greek Small Letter Theta + 0x3B9, 0x69, // Greek Small Letter Iota + 0x3BA, 0x6B, // Greek Small Letter Kappa + 0x3BB, 0x6C, // Greek Small Letter Lamda + 0x3BC, 0x6D, // Greek Small Letter Mu + 0x3BD, 0x6E, // Greek Small Letter Nu + 0x3BE, 0x78, // Greek Small Letter Xi + 0x3BF, 0x6F, // Greek Small Letter Omicron + 0x3C0, 0x70, // Greek Small Letter Pi + 0x3C1, 0x72, // Greek Small Letter Rho + 0x3C2, 0x63, // Greek Small Letter Final Sigma + 0x3C3, 0x73, // Greek Small Letter Sigma + 0x3C4, 0x74, // Greek Small Letter Tau + 0x3C5, 0x75, // Greek Small Letter Upsilon + 0x3C6, 0x66, // Greek Small Letter Phi + 0x3C7, 0x71, // Greek Small Letter Chi + 0x3C8, 0x79, // Greek Small Letter Psi + 0x3C9, 0x77, // Greek Small Letter Omega + + 0x3CA, 0xF0, // Greek Small Letter Iota with Dialytika +// 0x3CB, 0x0F, // Greek Small Letter Upsilon with Dialytika + 0x3CB, 0xF4, // Greek Small Letter Upsilon with Dialytika + 0x3CC, 0xEC, // Greek Small Letter Omicron with Tonos + 0x3CD, 0xD4, // Greek Small Letter Upsilon with Tonos + 0x3CE, 0xB8, // Greek Small Letter Omega with Tonos + 0x3D8, 0x15, // Greek Letter Archaic Koppa + 0x3D9, 0x13, // Greek Small Letter Archaic Koppa + 0x3DA, 0x16, // Greek Letter Stigma + 0x3DB, 0x06, // Greek Small Letter Stigma + 0x3DD, 0x93, // Greek Small Letter Digamma + 0x3DF, 0x12, // Greek Small Letter Koppa + 0x3E0, 0x17, // Greek Letter Sampi + 0x3E1, 0x1B, // Greek Small Letter Sampi + + 0x1F00, 0x82, // Greek Small Letter Alpha with Psili + 0x1F01, 0x81, // Greek Small Letter Alpha with Dasia + 0x1F02, 0x8B, // Greek Small Letter Alpha with Psili and Varia + 0x1F03, 0x83, // Greek Small Letter Alpha with Dasia and Varia + 0x1F04, 0x8A, // Greek Small Letter Alpha with Psili and Oxia + 0x1F05, 0x89, // Greek Small Letter Alpha with Dasia and Oxia + 0x1F06, 0x92, // Greek Small Letter Alpha with Psili and Perispomeni + 0x1F07, 0x91, // Greek Small Letter Alpha with Dasia and Perispomeni + 0x1F10, 0xE2, // Greek Small Letter Epsilon with Psili + 0x1F11, 0xE1, // Greek Small Letter Epsilon with Dasia + 0x1F12, 0xEB, // Greek Small Letter Epsilon with Psili and Varia + 0x1F13, 0xE3, // Greek Small Letter Epsilon with Dasia and Varia + 0x1F14, 0xEA, // Greek Small Letter Epsilon with Psili and Oxia + 0x1F15, 0xE9, // Greek Small Letter Epsilon with Dasia and Oxia + 0x1F20, 0x9A, // Greek Small Letter Eta with Psili + 0x1F21, 0x99, // Greek Small Letter Eta with Dasia + 0x1F22, 0xAB, // Greek Small Letter Eta with Psili and Varia + 0x1F23, 0xA3, // Greek Small Letter Eta with Dasia and Varia + 0x1F24, 0xA2, // Greek Small Letter Eta with Psili and Oxia + 0x1F25, 0xA1, // Greek Small Letter Eta with Dasia and Oxia + 0x1F26, 0xAA, // Greek Small Letter Eta with Psili and Perispomeni + 0x1F27, 0xA9, // Greek Small Letter Eta with Dasia and Perispomeni + 0x1F30, 0xCA, // Greek Small Letter Iota with Psili + 0x1F31, 0xC9, // Greek Small Letter Iota with Dasia + 0x1F32, 0xD3, // Greek Small Letter Iota with Psili and Varia + 0x1F33, 0xCB, // Greek Small Letter Iota with Dasia and Varia + 0x1F34, 0xD2, // Greek Small Letter Iota with Psili and Oxia + 0x1F35, 0xD1, // Greek Small Letter Iota with Dasia and Oxia + 0x1F36, 0xDA, // Greek Small Letter Iota with Psili and Perispomeni + 0x1F37, 0xD9, // Greek Small Letter Iota with Dasia and Perispomeni + 0x1F40, 0xE6, // Greek Small Letter Omicron with Psili + 0x1F41, 0xE5, // Greek Small Letter Omicron with Dasia + 0x1F42, 0xEF, // Greek Small Letter Omicron with Psili and Varia + 0x1F43, 0xE7, // Greek Small Letter Omicron with Dasia and Varia + 0x1F44, 0xEE, // Greek Small Letter Omicron with Psili and Oxia + 0x1F45, 0xED, // Greek Small Letter Omicron with Dasia and Oxia + 0x1F50, 0xCE, // Greek Small Letter Upsilon with Psili + 0x1F51, 0xCD, // Greek Small Letter Upsilon with Dasia + 0x1F52, 0xD7, // Greek Small Letter Upsilon with Psili and Varia + 0x1F53, 0xCF, // Greek Small Letter Upsilon with Dasia and Varia + 0x1F54, 0xD6, // Greek Small Letter Upsilon with Psili and Oxia + 0x1F55, 0xD5, // Greek Small Letter Upsilon with Dasia and Oxia + 0x1F56, 0xDE, // Greek Small Letter Upsilon with Psili and Perispomeni + 0x1F57, 0xDD, // Greek Small Letter Upsilon with Dasia and Perispomeni + 0x1F60, 0xB2, // Greek Small Letter Omega with Psili + 0x1F61, 0xB1, // Greek Small Letter Omega with Dasia + 0x1F62, 0xBB, // Greek Small Letter Omega with Psili and Varia + 0x1F63, 0xB3, // Greek Small Letter Omega with Dasia and Varia + 0x1F64, 0xBA, // Greek Small Letter Omega with Psili and Oxia + 0x1F65, 0xB9, // Greek Small Letter Omega with Dasia and Oxia + 0x1F66, 0xC2, // Greek Small Letter Omega with Psili and Perispomeni + 0x1F67, 0xC1, // Greek Small Letter Omega with Dasia and Perispomeni + 0x1F70, 0x80, // Greek Small Letter Alpha with Varia + 0x1F71, 0x88, // Greek Small Letter Alpha with Oxia + 0x1F72, 0xE0, // Greek Small Letter Epsilon with Varia + 0x1F73, 0xE8, // Greek Small Letter Epsilon with Oxia + 0x1F74, 0x98, // Greek Small Letter Eta with Varia + 0x1F75, 0xA0, // Greek Small Letter Eta with Oxia + 0x1F76, 0xC8, // Greek Small Letter Iota with Varia + 0x1F77, 0xD0, // Greek Small Letter Iota with Oxia + 0x1F78, 0xE4, // Greek Small Letter Omicron with Varia + 0x1F79, 0xEC, // Greek Small Letter Omicron with Oxia + 0x1F7A, 0xCC, // Greek Small Letter Upsilon with Varia + 0x1F7B, 0xD4, // Greek Small Letter Upsilon with Oxia + 0x1F7C, 0xB0, // Greek Small Letter Omega with Varia + 0x1F7D, 0xB8, // Greek Small Letter Omega with Oxia + 0x1F80, 0x86, // Greek Small Letter Alpha with Psili and Ypogegrammeni + 0x1F81, 0x85, // Greek Small Letter Alpha with Dasia and Ypogegrammeni + 0x1F82, 0x8F, // Greek Small Letter Alpha with Psili and Varia and Ypogegrammeni + 0x1F83, 0x87, // Greek Small Letter Alpha with Dasia and Varia and Ypogegrammeni + 0x1F84, 0x8E, // Greek Small Letter Alpha with Psili and Oxia and Ypogegrammeni + 0x1F85, 0x8D, // Greek Small Letter Alpha with Dasia and Oxia and Ypogegrammeni + 0x1F86, 0x96, // Greek Small Letter Alpha with Psili and Perispomeni and Ypogegrammeni + 0x1F87, 0x95, // Greek Small Letter Alpha with Dasia and Perispomeni and Ypogegrammeni + 0x1F90, 0x9E, // Greek Small Letter Eta with Psili and Ypogegrammeni + 0x1F91, 0x9D, // Greek Small Letter Eta with Dasia and Ypogegrammeni + 0x1F92, 0xAF, // Greek Small Letter Eta with Psili and Varia and Ypogegrammeni + 0x1F93, 0xA7, // Greek Small Letter Eta with Dasia and Varia and Ypogegrammeni + 0x1F94, 0xA6, // Greek Small Letter Eta with Psili and Oxia and Ypogegrammeni + 0x1F95, 0xA5, // Greek Small Letter Eta with Dasia and Oxia and Ypogegrammeni + 0x1F96, 0xAE, // Greek Small Letter Eta with Psili and Perispomeni and Ypogegrammeni + 0x1F97, 0xAD, // Greek Small Letter Eta with Dasia and Perispomeni and Ypogegrammeni + 0x1FA0, 0xB6, // Greek Small Letter Omega with Psili and Ypogegrammeni + 0x1FA1, 0xB5, // Greek Small Letter Omega with Dasia and Ypogegrammeni + 0x1FA2, 0xBF, // Greek Small Letter Omega with Psili and Varia and Ypogegrammeni + 0x1FA3, 0xB7, // Greek Small Letter Omega with Dasia and Varia and Ypogegrammeni + 0x1FA4, 0xBE, // Greek Small Letter Omega with Psili and Oxia and Ypogegrammeni + 0x1FA5, 0xBD, // Greek Small Letter Omega with Dasia and Oxia and Ypogegrammeni + 0x1FA6, 0xC6, // Greek Small Letter Omega with Psili and Perispomeni and Ypogegrammeni + 0x1FA7, 0xC5, // Greek Small Letter Omega with Dasia and Perispomeni and Ypogegrammeni + 0x1FB2, 0x84, // Greek Small Letter Alpha with Varia and Ypogegrammeni + 0x1FB3, 0xF8, // Greek Small Letter Alpha with Ypogegrammeni + 0x1FB4, 0x8C, // Greek Small Letter Alpha with Oxia and Ypogegrammeni + 0x1FB6, 0x90, // Greek Small Letter Alpha with Perispomeni + 0x1FB7, 0x94, // Greek Small Letter Alpha with Perispomeni and Ypogegrammeni + 0x1FBC, 0x09, // Greek Capital Letter Alpha with Prosgegrammeni + 0x1FBD, 0x3E, // Greek Koronis + 0x1FBE, 0x08, // Greek Prosgegrammeni + 0x1FBF, 0x3E, // Greek Psili + 0x1FC0, 0x7E, // Greek Perispomeni + 0x1FC1, 0x20, // Greek Dialytika and Perispomeni + 0x1FC2, 0x9C, // Greek Small Letter Eta with Varia and Ypogegrammeni + 0x1FC3, 0xF9, // Greek Small Letter Eta with Ypogegrammeni + 0x1FC4, 0xA4, // Greek Small Letter Eta with Oxia and Ypogegrammeni + 0x1FC6, 0xA8, // Greek Small Letter Eta with Perispomeni + 0x1FC7, 0xAC, // Greek Small Letter Eta with Perispomeni and Ypogegrammeni + 0x1FCC, 0x0A, // Greek Capital Letter Eta with Prosgegrammeni + 0x1FCD, 0x5F, // Greek Psili and Varia + 0x1FCE, 0x5E, // Greek Psili and Oxia + 0x1FCF, 0x5C, // Greek Psili and Perispomeni + 0x1FD2, 0xF1, // Greek Small Letter Iota with Dialytika and Varia + 0x1FD3, 0xF2, // Greek Small Letter Iota with Dialytika and Oxia + 0x1FD6, 0xD8, // Greek Small Letter Iota with Perispomeni + 0x1FD7, 0xF3, // Greek Small Letter Iota with Dialytika and Perispomeni + 0x1FDD, 0x43, // Greek Dasia and Varia + 0x1FDE, 0x56, // Greek Dasia and Oxia + 0x1FDF, 0x40, // Greek Dasia and Perispomeni + 0x1FE2, 0xF5, // Greek Small Letter Upsilon with Dialytika and Varia + 0x1FE3, 0xF6, // Greek Small Letter Upsilon with Dialytika and Oxia + 0x1FE4, 0xFC, // Greek Small Letter Rho with Psili + 0x1FE5, 0xFB, // Greek Small Letter Rho with Dasia + 0x1FE6, 0xDC, // Greek Small Letter Upsilon with Perispomeni + 0x1FE7, 0xF7, // Greek Small Letter Upsilon with Dialytika and Perispomeni + 0x1FED, 0x23, // Greek Dialytika and Varia + 0x1FEE, 0x24, // Greek Dialytika and Oxia + 0x1FEF, 0x60, // Greek Varia + 0x1FF2, 0xB4, // Greek Small Letter Omega with Varia and Ypogegrammeni + 0x1FF3, 0xFA, // Greek Small Letter Omega with Ypogegrammeni + 0x1FF4, 0xBC, // Greek Small Letter Omega with Oxia and Ypogegrammeni + 0x1FF6, 0xC0, // Greek Small Letter Omega with Perispomeni + 0x1FF7, 0xC4, // Greek Small Letter Omega with Perispomeni and Ypogegrammeni + 0x1FFC, 0x0B, // Greek Capital Letter Omega with Prosgegrammeni + 0x1FFD, 0x27, // Greek Oxia + 0x1FFE, 0x3C, // Greek Dasia + 0x2013, 0x00, + 0x2014, 0x7F, + 0x2018, 0x1C, + 0x2019, 0x1D, + 0x2030, 0x19, + 0x20AC, 0x18, + 0x2126, 0x57, +}; + +#endif /* TEX8BENC_H */ + +#ifdef __cplusplus +} +#endif + diff --git a/Build/source/texk/ptexenc/unicode.c b/Build/source/texk/ptexenc/unicode.c index 367b2359e24..998e75b95cd 100644 --- a/Build/source/texk/ptexenc/unicode.c +++ b/Build/source/texk/ptexenc/unicode.c @@ -6,6 +6,7 @@ #include <ptexenc/c-auto.h> #include <ptexenc/unicode.h> #include <ptexenc/kanjicnv.h> +#include <tex8benc.h> #include <stdio.h> /* for fprintf() */ @@ -335,3 +336,85 @@ UVS_divide_code(long code, long* uvs) if (uvs) *uvs = 0; return 0; } + +long +ptenc_ucs_to_8bit_code(short enc, long uch) +{ + unsigned short *UCSto_enc, uch0; + int mid, left, right, size; + + if (enc<0x80 || uch<0x80) return uch; /* no conversion */ + + switch (enc) { + case 0x80: UCSto_enc = UCStoT1enc; size = sizeof(UCStoT1enc); + break; + case 0x81: UCSto_enc = UCStoTS1enc; size = sizeof(UCStoTS1enc); + break; + case 0x82: UCSto_enc = UCStoLY1enc; size = sizeof(UCStoLY1enc); + break; + case 0x83: UCSto_enc = UCStoT5enc; size = sizeof(UCStoT5enc); + break; + case 0x84: UCSto_enc = UCStoL7Xenc; size = sizeof(UCStoL7Xenc); + break; + case 0x90: UCSto_enc = UCStoT2Aenc; size = sizeof(UCStoT2Aenc); + break; + case 0x91: UCSto_enc = UCStoT2Benc; size = sizeof(UCStoT2Benc); + break; + case 0x92: UCSto_enc = UCStoT2Cenc; size = sizeof(UCStoT2Cenc); + break; + case 0xA0: UCSto_enc = UCStoLGRenc; size = sizeof(UCStoLGRenc); + break; + default: + return 256; /* not supported yet */ + } + + left = 0; + right = size/(sizeof(unsigned short)*2); + while (left < right) { + mid = (left + right) / 2; + uch0 = UCSto_enc[mid*2]; + if ( uch0 == uch ) return (long)UCSto_enc[mid*2+1]; + if ( uch0 < uch ) left = mid + 1; + else right = mid; + } + return 256; +} + +long +ptenc_8bit_code_to_ucs(short enc, long ech) +{ + unsigned short *UCSto_enc; + int ii, size; + + if (enc<0x80) return ech; /* no conversion */ + if (ech>0xFF) return 0xFFFD; /* illegal */ + + switch (enc) { + case 0x80: UCSto_enc = UCStoT1enc; size = sizeof(UCStoT1enc); + break; + case 0x81: UCSto_enc = UCStoTS1enc; size = sizeof(UCStoTS1enc); + break; + case 0x82: UCSto_enc = UCStoLY1enc; size = sizeof(UCStoLY1enc); + break; + case 0x83: UCSto_enc = UCStoT5enc; size = sizeof(UCStoT5enc); + break; + case 0x84: UCSto_enc = UCStoL7Xenc; size = sizeof(UCStoL7Xenc); + break; + case 0x90: UCSto_enc = UCStoT2Aenc; size = sizeof(UCStoT2Aenc); + break; + case 0x91: UCSto_enc = UCStoT2Benc; size = sizeof(UCStoT2Benc); + break; + case 0x92: UCSto_enc = UCStoT2Cenc; size = sizeof(UCStoT2Cenc); + break; + case 0xA0: UCSto_enc = UCStoLGRenc; size = sizeof(UCStoLGRenc); + break; + default: + return 0xFFFD; /* not supported yet */ + } + + size = size/(sizeof(unsigned short)*2); + for (ii=0; ii<size; ii++) { + if ( UCSto_enc[ii*2+1] == ech ) return (long)UCSto_enc[ii*2]; + } + return ech; /* no conversion */ +} diff --git a/Build/source/texk/ptexenc/version.ac b/Build/source/texk/ptexenc/version.ac index 76531c8baf2..226dee9ec60 100644 --- a/Build/source/texk/ptexenc/version.ac +++ b/Build/source/texk/ptexenc/version.ac @@ -11,4 +11,4 @@ dnl Keep package and shared library versions the same; dnl see kpathsea/version.ac. dnl dnl This file is m4-included from configure.ac. -m4_define([ptexenc_version], [1.5.0/dev]) +m4_define([ptexenc_version], [1.5.1/dev]) |