texlive[69656] Build/source/texk: ptexenc: Add a new simple encoding

commits+takuji at tug.org commits+takuji at tug.org
Thu Feb 1 12:52:39 CET 2024


Revision: 69656
          https://tug.org/svn/texlive?view=revision&revision=69656
Author:   takuji
Date:     2024-02-01 12:52:39 +0100 (Thu, 01 Feb 2024)
Log Message:
-----------
ptexenc: Add a new simple encoding conversion utility "ptekf"

Modified Paths:
--------------
    trunk/Build/source/texk/ptexenc/COPYRIGHT
    trunk/Build/source/texk/ptexenc/ChangeLog
    trunk/Build/source/texk/ptexenc/Makefile.am
    trunk/Build/source/texk/ptexenc/Makefile.in
    trunk/Build/source/texk/ptexenc/c-auto.in
    trunk/Build/source/texk/ptexenc/configure
    trunk/Build/source/texk/ptexenc/configure.ac
    trunk/Build/source/texk/ptexenc/kanjicnv.c
    trunk/Build/source/texk/ptexenc/ptexenc/kanjicnv.h
    trunk/Build/source/texk/ptexenc/ptexenc/ptexenc.h
    trunk/Build/source/texk/ptexenc/ptexenc.c
    trunk/Build/source/texk/ptexenc/version.ac
    trunk/Build/source/texk/web2c/ChangeLog
    trunk/Build/source/texk/web2c/tests/enc-ep.bbl
    trunk/Build/source/texk/web2c/tests/enc-eu.bbl
    trunk/Build/source/texk/web2c/tests/enc-p.bbl
    trunk/Build/source/texk/web2c/tests/enc-sp.bbl
    trunk/Build/source/texk/web2c/tests/enc-su.bbl
    trunk/Build/source/texk/web2c/tests/enc-u.bbl
    trunk/Build/source/texk/web2c/tests/enc-up.bbl
    trunk/Build/source/texk/web2c/tests/enc-utf8.bib
    trunk/Build/source/texk/web2c/tests/enc-uu.bbl

Added Paths:
-----------
    trunk/Build/source/texk/ptexenc/ptekf.c
    trunk/Build/source/texk/ptexenc/tests/
    trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-euc
    trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-euc-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-jis
    trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-sjis
    trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-sjis-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-euc
    trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-jis
    trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-sjis
    trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-sjis-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-amb2.bib-euc-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-amb2.bib-sjis-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-euc.bib-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-jis.bib-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-sjis.bib-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-euc
    trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-jis
    trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-sjis
    trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-euc
    trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-jis
    trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-sjis
    trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-utf8
    trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-euc
    trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-jis
    trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-sjis
    trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-utf8
    trunk/Build/source/texk/ptexenc/tests/ptekf-conv.test
    trunk/Build/source/texk/ptexenc/tests/ptekf-guess.test
    trunk/Build/source/texk/ptexenc/tests/ptekf-smoke.test

Modified: trunk/Build/source/texk/ptexenc/COPYRIGHT
===================================================================
--- trunk/Build/source/texk/ptexenc/COPYRIGHT	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/COPYRIGHT	2024-02-01 11:52:39 UTC (rev 69656)
@@ -1,6 +1,6 @@
 Copyright (C) 2009 ASCII MEDIA WORKS.
 Copyright (C) 2006-2010 N. Tsuchimura
-Copyright (C) 2010-2023 Japanese TeX Development Community
+Copyright (C) 2010-2024 Japanese TeX Development Community
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without

Modified: trunk/Build/source/texk/ptexenc/ChangeLog
===================================================================
--- trunk/Build/source/texk/ptexenc/ChangeLog	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/ChangeLog	2024-02-01 11:52:39 UTC (rev 69656)
@@ -1,3 +1,21 @@
+2024-02-01  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* ptexenc.c, ptexenc/ptexenc.h, kanjicnv.c, ptexenc/kanjicnv.h:
+	Add to support ISO-8859 in guessing input file encodings.
+	* ptekf.c: Add a new simple encoding conversion utility "ptekf"
+	to analyze file encoding conversion procedure.
+	* tests/ptekf-{smoke,guess,conv}.test,
+	tests/enc-amb0.bib-{euc,euc-utf8,jis,sjis,sjis-utf8,utf8},
+	tests/enc-amb1.bib-{euc,jis,sjis,sjis-utf8,utf8},
+	tests/enc-amb2,bib_{euc,sjis}-utf8,
+	tests/enc-{euc,jis,sjis}.bib-utf8,
+	tests/enc-utf8{,a,b}.bib-{euc,jis,sjis,utf8}:
+	New tests to guess/convert encoding.
+	https://github.com/texjporg/tex-jp-build/issues/142
+	* configure.ac, Makefile.am: Adjust.
+	* version.ac, COPYRIGHT: Update copyright year.
+	* version.ac: Bump to 1.4.5/dev.
+
 2023-09-11  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	* unicode.c (UPTEXtoUCS): if >=UCS_MAX not >UCS_MAX.

Modified: trunk/Build/source/texk/ptexenc/Makefile.am
===================================================================
--- trunk/Build/source/texk/ptexenc/Makefile.am	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/Makefile.am	2024-02-01 11:52:39 UTC (rev 69656)
@@ -3,7 +3,7 @@
 ## Copyright (C) 2010-2014 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 ##
-AM_CPPFLAGS = $(KPATHSEA_INCLUDES)
+AM_CPPFLAGS = $(PTEXENC_INCLUDES) $(KPATHSEA_INCLUDES) -DKPATHSEA -DPTEXENC
 AM_CFLAGS = $(WARNING_CFLAGS)
 
 lib_LTLIBRARIES = libptexenc.la
@@ -40,6 +40,35 @@
 
 EXTRA_DIST = COPYRIGHT ChangeLog.jp
 
+## The programs
+bin_PROGRAMS = ptekf
+ptekf_LDADD = libptexenc.la
+
+LDADD = $(KPATHSEA_LIBS)
+
+## Tests
+#
+TESTS = tests/ptekf-smoke.test tests/ptekf-guess.test  tests/ptekf-conv.test
+#
+tests/ptekf-smoke.log tests/ptekf-guess.log tests/ptekf-conv.log \
+  : ptekf$(EXEEXT)
+#
+EXTRA_DIST += $(TESTS)
+#
+## ptekf-conv.test
+EXTRA_DIST += \
+  tests/enc-amb0.bib-euc tests/enc-amb0.bib-euc-utf8 tests/enc-amb0.bib-jis \
+  tests/enc-amb0.bib-sjis tests/enc-amb0.bib-sjis-utf8 tests/enc-amb0.bib-utf8 \
+  tests/enc-amb1.bib-euc tests/enc-amb1.bib-jis tests/enc-amb1.bib-sjis \
+  tests/enc-amb1.bib-sjis-utf8 tests/enc-amb1.bib-utf8 \
+  tests/enc-amb2.bib-euc-utf8 tests/enc-amb2.bib-sjis-utf8 \
+  tests/enc-euc.bib-utf8 tests/enc-jis.bib-utf8 tests/enc-sjis.bib-utf8 \
+  tests/enc-utf8.bib-euc tests/enc-utf8.bib-jis tests/enc-utf8.bib-sjis tests/enc-utf8.bib-utf8 \
+  tests/enc-utf8a.bib-euc tests/enc-utf8a.bib-jis tests/enc-utf8a.bib-sjis tests/enc-utf8a.bib-utf8 \
+  tests/enc-utf8b.bib-euc tests/enc-utf8b.bib-jis tests/enc-utf8b.bib-sjis tests/enc-utf8b.bib-utf8
+DISTCLEANFILES = enc-*.bib*
+
+
 # Rebuild
 rebuild_prereq =
 rebuild_target = all

Modified: trunk/Build/source/texk/ptexenc/Makefile.in
===================================================================
--- trunk/Build/source/texk/ptexenc/Makefile.in	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/Makefile.in	2024-02-01 11:52:39 UTC (rev 69656)
@@ -16,6 +16,7 @@
 
 
 
+
 VPATH = @srcdir@
 am__is_gnu_make = { \
   if test -z '$(MAKELEVEL)'; then \
@@ -90,6 +91,7 @@
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
+bin_PROGRAMS = ptekf$(EXEEXT)
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \
@@ -101,7 +103,7 @@
 	$(top_srcdir)/../../m4/ltsugar.m4 \
 	$(top_srcdir)/../../m4/ltversion.m4 \
 	$(top_srcdir)/../../m4/lt~obsolete.m4 $(top_srcdir)/version.ac \
-	$(top_srcdir)/configure.ac
+	$(top_srcdir)/../../version.ac $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
@@ -113,6 +115,9 @@
 CONFIG_HEADER = $(top_builddir)/ptexenc/c-auto.h
 CONFIG_CLEAN_FILES = ptexenc.pc
 CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" \
+	"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"
+PROGRAMS = $(bin_PROGRAMS)
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -140,8 +145,6 @@
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \
-	"$(DESTDIR)$(includedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libptexenc_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
@@ -156,6 +159,9 @@
 libptexenc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(libptexenc_la_LDFLAGS) $(LDFLAGS) -o $@
+ptekf_SOURCES = ptekf.c
+ptekf_OBJECTS = ptekf.$(OBJEXT)
+ptekf_DEPENDENCIES = libptexenc.la
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -174,7 +180,7 @@
 am__depfiles_remade = ./$(DEPDIR)/libptexenc_la-kanjicnv.Plo \
 	./$(DEPDIR)/libptexenc_la-ptexenc.Plo \
 	./$(DEPDIR)/libptexenc_la-unicode-jp.Plo \
-	./$(DEPDIR)/libptexenc_la-unicode.Plo
+	./$(DEPDIR)/libptexenc_la-unicode.Plo ./$(DEPDIR)/ptekf.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -194,8 +200,8 @@
 am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(libptexenc_la_SOURCES)
-DIST_SOURCES = $(libptexenc_la_SOURCES)
+SOURCES = $(libptexenc_la_SOURCES) ptekf.c
+DIST_SOURCES = $(libptexenc_la_SOURCES) ptekf.c
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -221,7 +227,182 @@
   unique=`for i in $$list; do \
     if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   done | $(am__uniquify_input)`
-AM_RECURSIVE_TARGETS = cscope
+AM_RECURSIVE_TARGETS = cscope check recheck
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+am__recheck_rx = ^[ 	]*:recheck:[ 	]*
+am__global_test_result_rx = ^[ 	]*:global-test-result:[ 	]*
+am__copy_in_global_log_rx = ^[ 	]*:copy-in-global-log:[ 	]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          if ((getline line2 < ($$0 ".log")) < 0) \
+	    recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+          break; \
+        } \
+    }; \
+  if (recheck) \
+    print $$0; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[ 	]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+      printf "\n"; \
+    }; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+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" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test.  Creates the
+# directory for the log if needed.  Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log.  Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup);					\
+$(am__vpath_adj_setup) $(am__vpath_adj)			\
+$(am__tty_colors);					\
+srcdir=$(srcdir); export srcdir;			\
+case "$@" in						\
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;	\
+    *) am__odir=.;; 					\
+esac;							\
+test "x$$am__odir" = x"." || test -d "$$am__odir" 	\
+  || $(MKDIR_P) "$$am__odir" || exit $$?;		\
+if test -f "./$$f"; then dir=./;			\
+elif test -f "$$f"; then dir=;				\
+else dir="$(srcdir)/"; fi;				\
+tst=$$dir$$f; log='$@'; 				\
+if test -n '$(DISABLE_HARD_ERRORS)'; then		\
+  am__enable_hard_errors=no; 				\
+else							\
+  am__enable_hard_errors=yes; 				\
+fi; 							\
+case " $(XFAIL_TESTS) " in				\
+  *[\ \	]$$f[\ \	]* | *[\ \	]$$dir$$f[\ \	]*) \
+    am__expect_failure=yes;;				\
+  *)							\
+    am__expect_failure=no;;				\
+esac; 							\
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed).  The result is saved in the shell variable
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT at .log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/../../build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+	$(TEST_LOG_FLAGS)
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
 am__DIST_COMMON = $(srcdir)/../../am/rebuild.am $(srcdir)/Makefile.in \
 	$(srcdir)/c-auto.in $(srcdir)/ptexenc.pc.in \
 	$(top_srcdir)/../../build-aux/ar-lib \
@@ -231,12 +412,14 @@
 	$(top_srcdir)/../../build-aux/depcomp \
 	$(top_srcdir)/../../build-aux/install-sh \
 	$(top_srcdir)/../../build-aux/ltmain.sh \
-	$(top_srcdir)/../../build-aux/missing ../../build-aux/ar-lib \
-	../../build-aux/compile ../../build-aux/config.guess \
-	../../build-aux/config.sub ../../build-aux/depcomp \
-	../../build-aux/install-sh ../../build-aux/ltmain.sh \
-	../../build-aux/missing ../../build-aux/texinfo.tex \
-	../../build-aux/ylwrap ChangeLog README
+	$(top_srcdir)/../../build-aux/missing \
+	$(top_srcdir)/../../build-aux/test-driver \
+	../../build-aux/ar-lib ../../build-aux/compile \
+	../../build-aux/config.guess ../../build-aux/config.sub \
+	../../build-aux/depcomp ../../build-aux/install-sh \
+	../../build-aux/ltmain.sh ../../build-aux/missing \
+	../../build-aux/texinfo.tex ../../build-aux/ylwrap ChangeLog \
+	README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -384,7 +567,7 @@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AM_CPPFLAGS = $(KPATHSEA_INCLUDES)
+AM_CPPFLAGS = $(PTEXENC_INCLUDES) $(KPATHSEA_INCLUDES) -DKPATHSEA -DPTEXENC
 AM_CFLAGS = $(WARNING_CFLAGS)
 lib_LTLIBRARIES = libptexenc.la
 libptexenc_la_CPPFLAGS = $(AM_CPPFLAGS) -DMAKE_PTENC_DLL
@@ -408,8 +591,30 @@
 
 pkgconfigdir = ${libdir}/pkgconfig
 pkgconfig_DATA = ptexenc.pc
-EXTRA_DIST = COPYRIGHT ChangeLog.jp
+#
+#
+EXTRA_DIST = COPYRIGHT ChangeLog.jp $(TESTS) tests/enc-amb0.bib-euc \
+	tests/enc-amb0.bib-euc-utf8 tests/enc-amb0.bib-jis \
+	tests/enc-amb0.bib-sjis tests/enc-amb0.bib-sjis-utf8 \
+	tests/enc-amb0.bib-utf8 tests/enc-amb1.bib-euc \
+	tests/enc-amb1.bib-jis tests/enc-amb1.bib-sjis \
+	tests/enc-amb1.bib-sjis-utf8 tests/enc-amb1.bib-utf8 \
+	tests/enc-amb2.bib-euc-utf8 tests/enc-amb2.bib-sjis-utf8 \
+	tests/enc-euc.bib-utf8 tests/enc-jis.bib-utf8 \
+	tests/enc-sjis.bib-utf8 tests/enc-utf8.bib-euc \
+	tests/enc-utf8.bib-jis tests/enc-utf8.bib-sjis \
+	tests/enc-utf8.bib-utf8 tests/enc-utf8a.bib-euc \
+	tests/enc-utf8a.bib-jis tests/enc-utf8a.bib-sjis \
+	tests/enc-utf8a.bib-utf8 tests/enc-utf8b.bib-euc \
+	tests/enc-utf8b.bib-jis tests/enc-utf8b.bib-sjis \
+	tests/enc-utf8b.bib-utf8
+ptekf_LDADD = libptexenc.la
+LDADD = $(KPATHSEA_LIBS)
 
+#
+TESTS = tests/ptekf-smoke.test tests/ptekf-guess.test  tests/ptekf-conv.test
+DISTCLEANFILES = enc-*.bib*
+
 # Rebuild
 rebuild_prereq = 
 rebuild_target = all
@@ -417,7 +622,7 @@
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
 am--refresh: Makefile
 	@:
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../am/rebuild.am $(am__configure_deps)
@@ -469,7 +674,56 @@
 	-rm -f ptexenc/c-auto.h ptexenc/stamp-h1
 ptexenc.pc: $(top_builddir)/config.status $(srcdir)/ptexenc.pc.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p \
+	 || test -f $$p1 \
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' \
+	    -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
 
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' \
+	`; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && 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
+
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
 	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
@@ -508,6 +762,10 @@
 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)
 
+ptekf$(EXEEXT): $(ptekf_OBJECTS) $(ptekf_DEPENDENCIES) $(EXTRA_ptekf_DEPENDENCIES) 
+	@rm -f ptekf$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ptekf_OBJECTS) $(ptekf_LDADD) $(LIBS)
+
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
 
@@ -518,6 +776,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libptexenc_la-ptexenc.Plo at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libptexenc_la-unicode-jp.Plo at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libptexenc_la-unicode.Plo at am__quote@ # am--include-marker
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ptekf.Po at am__quote@ # am--include-marker
 
 $(am__depfiles_remade):
 	@$(MKDIR_P) $(@D)
@@ -689,6 +948,162 @@
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+	rm -f $< $@
+	$(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+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"; }; \
+	redo_bases=`for i in $$bases; do \
+	              am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+	            done`; \
+	if test -n "$$redo_bases"; then \
+	  redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+	  redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+	  if $(am__make_dryrun); then :; else \
+	    rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+	  fi; \
+	fi; \
+	if test -n "$$am__remaking_logs"; then \
+	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+	       "recursion detected" >&2; \
+	elif test -n "$$redo_logs"; then \
+	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+	fi; \
+	if $(am__make_dryrun); then :; else \
+	  st=0;  \
+	  errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+	  for i in $$redo_bases; do \
+	    test -f $$i.trs && test -r $$i.trs \
+	      || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+	    test -f $$i.log && test -r $$i.log \
+	      || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+	  done; \
+	  test $$st -eq 0 || exit 1; \
+	fi
+	@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+	ws='[ 	]'; \
+	results=`for b in $$bases; do echo $$b.trs; done`; \
+	test -n "$$results" || results=/dev/null; \
+	all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+	pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+	fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+	skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+	xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+	xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+	error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+	if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+	  success=true; \
+	else \
+	  success=false; \
+	fi; \
+	br='==================='; br=$$br$$br$$br$$br; \
+	result_count () \
+	{ \
+	    if test x"$$1" = x"--maybe-color"; then \
+	      maybe_colorize=yes; \
+	    elif test x"$$1" = x"--no-color"; then \
+	      maybe_colorize=no; \
+	    else \
+	      echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+	    fi; \
+	    shift; \
+	    desc=$$1 count=$$2; \
+	    if test $$maybe_colorize = yes && test $$count -gt 0; then \
+	      color_start=$$3 color_end=$$std; \
+	    else \
+	      color_start= color_end=; \
+	    fi; \
+	    echo "$${color_start}# $$desc $$count$${color_end}"; \
+	}; \
+	create_testsuite_report () \
+	{ \
+	  result_count $$1 "TOTAL:" $$all   "$$brg"; \
+	  result_count $$1 "PASS: " $$pass  "$$grn"; \
+	  result_count $$1 "SKIP: " $$skip  "$$blu"; \
+	  result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+	  result_count $$1 "FAIL: " $$fail  "$$red"; \
+	  result_count $$1 "XPASS:" $$xpass "$$red"; \
+	  result_count $$1 "ERROR:" $$error "$$mgn"; \
+	}; \
+	{								\
+	  echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |	\
+	    $(am__rst_title);						\
+	  create_testsuite_report --no-color;				\
+	  echo;								\
+	  echo ".. contents:: :depth: 2";				\
+	  echo;								\
+	  for b in $$bases; do echo $$b; done				\
+	    | $(am__create_global_log);					\
+	} >$(TEST_SUITE_LOG).tmp || exit 1;				\
+	mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);			\
+	if $$success; then						\
+	  col="$$grn";							\
+	 else								\
+	  col="$$red";							\
+	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
+	fi;								\
+	echo "$${col}$$br$${std}"; 					\
+	echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}";	\
+	echo "$${col}$$br$${std}"; 					\
+	create_testsuite_report --maybe-color;				\
+	echo "$$col$$br$$std";						\
+	if $$success; then :; else					\
+	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";		\
+	  if test -n "$(PACKAGE_BUGREPORT)"; then			\
+	    echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${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)
+	@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`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+	exit $$?;
+recheck: all 
+	@test -z "$(TEST_SUITE_LOG)" || 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; \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	log_list=`echo $$log_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+	        am__force_recheck=am--force-recheck \
+	        TEST_LOGS="$$log_list"; \
+	exit $$?
+.test.log:
+	@p='$<'; \
+	$(am__set_b); \
+	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+ at am__EXEEXT_TRUE@.test$(EXEEXT).log:
+ at am__EXEEXT_TRUE@	@p='$<'; \
+ at am__EXEEXT_TRUE@	$(am__set_b); \
+ at am__EXEEXT_TRUE@	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ at am__EXEEXT_TRUE@	--log-file $$b.log --trs-file $$b.trs \
+ at am__EXEEXT_TRUE@	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ at am__EXEEXT_TRUE@	"$$tst" $(AM_TESTS_FD_REDIRECT)
 distdir: $(BUILT_SOURCES)
 	$(MAKE) $(AM_MAKEFLAGS) distdir-am
 
@@ -862,10 +1277,13 @@
 	       $(distcleancheck_listfiles) ; \
 	       exit 1; } >&2
 check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: check-am
-all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(DATA) $(HEADERS)
+install-binPROGRAMS: install-libLTLIBRARIES
+
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -888,6 +1306,9 @@
 	    "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)
 
 clean-generic:
 	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
@@ -895,6 +1316,7 @@
 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)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -901,8 +1323,8 @@
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
-	mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
+	clean-libtool mostlyclean-am
 
 distclean: distclean-am
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
@@ -910,6 +1332,7 @@
 	-rm -f ./$(DEPDIR)/libptexenc_la-ptexenc.Plo
 	-rm -f ./$(DEPDIR)/libptexenc_la-unicode-jp.Plo
 	-rm -f ./$(DEPDIR)/libptexenc_la-unicode.Plo
+	-rm -f ./$(DEPDIR)/ptekf.Po
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-hdr distclean-libtool distclean-tags
@@ -932,7 +1355,7 @@
 
 install-dvi-am:
 
-install-exec-am: install-libLTLIBRARIES
+install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
 
 install-html: install-html-am
 
@@ -961,6 +1384,7 @@
 	-rm -f ./$(DEPDIR)/libptexenc_la-ptexenc.Plo
 	-rm -f ./$(DEPDIR)/libptexenc_la-unicode-jp.Plo
 	-rm -f ./$(DEPDIR)/libptexenc_la-unicode.Plo
+	-rm -f ./$(DEPDIR)/ptekf.Po
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -977,20 +1401,21 @@
 
 ps-am:
 
-uninstall-am: uninstall-libLTLIBRARIES uninstall-nobase_includeHEADERS \
-	uninstall-pkgconfigDATA
+uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \
+	uninstall-nobase_includeHEADERS uninstall-pkgconfigDATA
 
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
 
 .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \
-	check-am clean clean-cscope clean-generic clean-libLTLIBRARIES \
-	clean-libtool cscope cscopelist-am ctags ctags-am dist \
-	dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
-	dist-xz dist-zip dist-zstd distcheck distclean \
-	distclean-compile distclean-generic distclean-hdr \
-	distclean-libtool distclean-tags distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
+	check-TESTS check-am clean clean-binPROGRAMS clean-cscope \
+	clean-generic clean-libLTLIBRARIES clean-libtool cscope \
+	cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
+	dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
+	dist-zstd distcheck distclean distclean-compile \
+	distclean-generic distclean-hdr distclean-libtool \
+	distclean-tags distcleancheck distdir distuninstallcheck dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-dvi \
 	install-dvi-am install-exec install-exec-am install-html \
 	install-html-am install-info install-info-am \
 	install-libLTLIBRARIES install-man \
@@ -999,7 +1424,8 @@
 	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \
+	recheck tags tags-am uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-libLTLIBRARIES \
 	uninstall-nobase_includeHEADERS uninstall-pkgconfigDATA
 
 .PRECIOUS: Makefile
@@ -1008,6 +1434,9 @@
 $(libptexenc_la_OBJECTS): $(KPATHSEA_DEPEND)
 
 @KPATHSEA_RULE@
+#
+tests/ptekf-smoke.log tests/ptekf-guess.log tests/ptekf-conv.log \
+  : ptekf$(EXEEXT)
 rebuild.stamp: $(rebuild_target)
 	echo timestamp >$@
 

Modified: trunk/Build/source/texk/ptexenc/c-auto.in
===================================================================
--- trunk/Build/source/texk/ptexenc/c-auto.in	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/c-auto.in	2024-02-01 11:52:39 UTC (rev 69656)
@@ -6,7 +6,7 @@
 #define PTEXENC_C_AUTO_H
 
 /* ptexenc: the version string. */
-#define PTEXENCVERSION "ptexenc version 1.4.4/dev"
+#define PTEXENCVERSION "ptexenc version 1.4.5/dev"
 
 /* Define to 1 if the 'closedir' function returns void instead of int. */
 #undef CLOSEDIR_VOID
@@ -155,6 +155,9 @@
    backward compatibility; new code need not use it. */
 #undef STDC_HEADERS
 
+/* Define to the current TeX Live version string. */
+#undef TL_VERSION
+
 /* Version number of package */
 #undef VERSION
 

Modified: trunk/Build/source/texk/ptexenc/configure
===================================================================
--- trunk/Build/source/texk/ptexenc/configure	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/configure	2024-02-01 11:52:39 UTC (rev 69656)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for ptexenc 1.4.4/dev.
+# Generated by GNU Autoconf 2.72 for ptexenc 1.4.5/dev.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -614,8 +614,8 @@
 # Identity of this package.
 PACKAGE_NAME='ptexenc'
 PACKAGE_TARNAME='ptexenc'
-PACKAGE_VERSION='1.4.4/dev'
-PACKAGE_STRING='ptexenc 1.4.4/dev'
+PACKAGE_VERSION='1.4.5/dev'
+PACKAGE_STRING='ptexenc 1.4.5/dev'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1363,7 +1363,7 @@
   # 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.4.4/dev to adapt to many kinds of systems.
+'configure' configures ptexenc 1.4.5/dev to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1434,7 +1434,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of ptexenc 1.4.4/dev:";;
+     short | recursive ) echo "Configuration of ptexenc 1.4.5/dev:";;
    esac
   cat <<\_ACEOF
 
@@ -1555,7 +1555,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-ptexenc configure 1.4.4/dev
+ptexenc configure 1.4.5/dev
 generated by GNU Autoconf 2.72
 
 Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2097,7 +2097,7 @@
 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.4.4/dev, which was
+It was created by ptexenc $as_me 1.4.5/dev, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -2875,10 +2875,10 @@
 
 
 
-PTEXENCVERSION=1.4.4/dev
+PTEXENCVERSION=1.4.5/dev
 
 
-PTEXENC_LT_VERSINFO=5:4:4
+PTEXENC_LT_VERSINFO=5:5:4
 
 
 am__api_version='1.16'
@@ -8664,7 +8664,7 @@
 
 # Define the identity of the package.
  PACKAGE='ptexenc'
- VERSION='1.4.4/dev'
+ VERSION='1.4.5/dev'
 
 
 printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -15005,7 +15005,7 @@
 Report bugs to <bug-libtool at gnu.org>."
 
 lt_cl_version="\
-ptexenc config.lt 1.4.4/dev
+ptexenc config.lt 1.4.5/dev
 configured by $0, generated by GNU Autoconf 2.72.
 
 Copyright (C) 2011 Free Software Foundation, Inc.
@@ -16233,6 +16233,11 @@
 
 
 
+
+
+printf "%s\n" "#define TL_VERSION \"TeX Live 2024\"" >>confdefs.h
+
+
 ac_config_files="$ac_config_files Makefile ptexenc.pc"
 
 
@@ -16772,7 +16777,7 @@
 # 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.4.4/dev, which was
+This file was extended by ptexenc $as_me 1.4.5/dev, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16840,7 +16845,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-ptexenc config.status 1.4.4/dev
+ptexenc config.status 1.4.5/dev
 configured by $0, generated by GNU Autoconf 2.72,
   with options \\"\$ac_cs_config\\"
 

Modified: trunk/Build/source/texk/ptexenc/configure.ac
===================================================================
--- trunk/Build/source/texk/ptexenc/configure.ac	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/configure.ac	2024-02-01 11:52:39 UTC (rev 69656)
@@ -50,6 +50,10 @@
 #define PTEXENCVERSION "ptexenc version] ptexenc_version["])
 AH_BOTTOM([#endif /* !PTEXENC_C_AUTO_H */])
 
+m4_include([../../version.ac])[] dnl define tex_live_version
+AC_DEFINE([TL_VERSION], ["TeX Live tex_live_version()"],
+          [Define to the current TeX Live version string.])
+
 AC_CONFIG_FILES([Makefile ptexenc.pc])
 
 AC_OUTPUT

Modified: trunk/Build/source/texk/ptexenc/kanjicnv.c
===================================================================
--- trunk/Build/source/texk/ptexenc/kanjicnv.c	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/kanjicnv.c	2024-02-01 11:52:39 UTC (rev 69656)
@@ -41,6 +41,12 @@
     return (0x40 <= c && c <= 0xfc && c != 0x7f);
 }
 
+boolean isISO8859(int c)
+{
+    c &= 0xff;
+    return (0xa0 <= c && c <= 0xff);
+}
+
 /* EUC <=> JIS X 0208 code conversion */
 int EUCtoJIS(int kcode)
 {

Added: trunk/Build/source/texk/ptexenc/ptekf.c
===================================================================
--- trunk/Build/source/texk/ptexenc/ptekf.c	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/ptekf.c	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,222 @@
+/*
+
+Copyright 2024 Japanese TeX Development Community <issue at texjp.org>
+Distributed under the 3-Clause BSD License.
+
+*/
+
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <kpathsea/getopt.h>
+#include <kpathsea/progname.h>
+#include <kpathsea/lib.h>
+
+#include <ptexenc/ptexenc.h>
+#include <c-auto.h>
+
+static char opt_input_enc[5];
+static char opt_output_enc[5];
+static int flg_guess_enc;
+static int flg_output_buffer;
+
+#define GUESS_ONLY        -1
+#define GUESS_AND_OUTPUT  +1
+
+#define BUFFERLEN 4096
+static char buff[BUFFERLEN];
+
+static const char *optstr = "hvgbjseuGJSEU";
+
+static struct option long_options[] = {
+  {"help",    0, 0, 'h'},
+  {"version", 0, 0, 'v'},
+  {"guess",   0, 0, 'g'},
+  {"buffer",  0, 0, 'b'},
+  {0, 0, 0, 0}
+};
+
+#define MY_VERSION   "20240201"
+#define BUG_ADDRESS  "issue at texjp.org"
+
+static void show_version(void)
+{
+  printf("ptekf  ver." MY_VERSION " (%s) (%s, %s)\n", get_enc_string(), ptexenc_version_string, TL_VERSION);
+  printf("    Copyright (C) 2024 Japanese TeX Development Community\n");
+}
+
+static void show_usage(void)
+{
+  printf("Usage: ptekf -[OPTION] [--] in_file1 [in_file2 ..]\n");
+  printf("  j/s/e/u  Specify output encoding ISO-2022-JP, Shift_JIS, EUC-JP, UTF8\n");
+  printf("  J/S/E/U  Specify input encoding ISO-2022-JP, Shift_JIS, EUC-JP, UTF8\n");
+  printf("  G        Guess the input encoding and output to stdout or files\n");
+  printf("  --guess    -g  Guess the input encoding (no conversion)\n");
+  printf("  --version  -v  Print version number\n");
+  printf("  --help     -h  Print this help\n");
+  printf("  --buffer   -b  Output internal buffer without code conversion\n");
+  printf("Default input/output encoding depends on kpathsearch parameters PTEX_KANJI_ENC, guess_input_kanji_encoding\n");
+  printf("\nEmail bug reports to %s.\n", BUG_ADDRESS);
+}
+
+const char  *infname;
+char        *outfname;
+FILE        *infp, *outfp;
+
+#if defined(WIN32)
+#define R_MODE "rb"
+#define W_MODE "wb"
+#else
+#define R_MODE "r"
+#define W_MODE "w"
+#endif
+
+static char *mfgets(char *buff, int size, FILE *fp)
+{
+  int c, len;
+
+  if ((len = input_line2(fp, (unsigned char *)buff, NULL, 0, size, &c)) == 0
+      && c != '\r' && c != '\n') return NULL;
+  if (c == '\n' || c == '\r') {
+    if (len+1 < size) strcat(buff+len, "\n");
+    else ungetc(c, fp);
+  }
+  if (c == EOF) return NULL;
+  return buff;
+}
+
+
+int
+main (int argc,  char **argv)
+{
+  int c;
+  int opt_ienc=0, opt_oenc=0;
+  int (*fputs__)(const char*, FILE*);
+
+  if (argc<=1) {
+    show_version();
+    show_usage();
+    return 0;
+  }
+  kpse_set_program_name(argv[0], "ptekf");
+#if defined(WIN32)
+  {
+    int ac;
+    char **av, *enc;
+    file_system_codepage = CP_UTF8;
+    is_cp932_system = 0;
+    if (get_command_line_args_utf8("utf-8", &ac, &av)) {
+      argv = av;
+      argc = ac;
+    }
+  }
+#endif
+  enable_UPTEX(true);
+
+  while ((c = getopt_long(argc, argv, optstr, long_options, NULL)) != -1) {
+    switch (c) {
+
+    case 'G': /* guess and output to stdout or files */
+      flg_guess_enc = GUESS_AND_OUTPUT;
+      opt_ienc++;
+      break;
+
+    case 'g': /* guess */
+      flg_guess_enc = GUESS_ONLY;
+      opt_ienc++;
+      break;
+
+    case 'b': /* output internal buffer */
+      flg_output_buffer = 1;
+      opt_oenc++;
+      break;
+
+    case 'h': /* help */
+      show_version();
+      show_usage();
+      return 0;
+
+    case 'v': /* version */
+      show_version();
+      return 0;
+
+    /* input encoding */
+    case 'J': strcpy(opt_input_enc,  "jis")  ; opt_ienc++; break;
+    case 'S': strcpy(opt_input_enc,  "sjis") ; opt_ienc++; break;
+    case 'E': strcpy(opt_input_enc,  "euc")  ; opt_ienc++; break;
+    case 'U': strcpy(opt_input_enc,  "utf8") ; opt_ienc++; break;
+
+    /* output encoding */
+    case 'j': strcpy(opt_output_enc, "jis")  ; opt_oenc++; break;
+    case 's': strcpy(opt_output_enc, "sjis") ; opt_oenc++; break;
+    case 'e': strcpy(opt_output_enc, "euc")  ; opt_oenc++; break;
+    case 'u': strcpy(opt_output_enc, "utf8") ; opt_oenc++; break;
+    }
+  }
+
+  if (opt_ienc>1) {
+    fprintf(stderr, "Option (--guess or -g), -G, -J, -S, -E and -U are mutually exclusive\n");
+    exit(16);
+  }
+  if (opt_oenc>1) {
+    fprintf(stderr, "Option (--buffer or -b), -j, -s, -e and -u are mutually exclusive\n");
+    exit(16);
+  }
+
+  fputs__ = flg_output_buffer ? fputs : fputs2; /* without/with code conversion */
+
+  while (optind < argc) {
+    char *genc, *ret;
+
+    infname = argv[optind++];
+    if ((infp = fopen(infname, R_MODE)) == 0) {
+      fprintf(stderr, "ERROR: fail to open input file [%s].", infname);
+      exit(32);
+    }
+    if (flg_guess_enc) {
+      genc = ptenc_guess_enc(infp, 1);
+      printf("%s: %s\n", infname, genc);
+      setinfileenc(infp, genc);
+      free(genc);
+    }
+
+    if ((opt_ienc && flg_guess_enc!=GUESS_ONLY) || opt_oenc) {
+      if (opt_oenc) {
+        outfname = xmalloc(strlen(infname)+5);
+        strcpy(outfname, infname);
+        strcat(outfname, ".out");
+
+        if ((outfp = fopen(outfname, W_MODE)) == 0) {
+          fprintf(stderr, "ERROR: fail to open output file [%s].", outfname);
+          exit(32);
+        }
+      }
+      else
+        outfp = stdout;
+
+      if (strlen(opt_input_enc)) {
+        setinfileenc(infp, opt_input_enc);
+      }
+      if (strlen(opt_output_enc)) {
+        setfileenc(opt_output_enc);
+      }
+      while ((ret = mfgets(buff, BUFFERLEN, infp)) != NULL) {
+        (*fputs__)(buff, outfp);
+      }
+      if (fclose(infp)) {
+        fprintf(stderr, "ERROR: fail to close input file [%s].", infname);
+        exit(32);
+      }
+      if (outfp != stdout && fclose(outfp)) {
+        fprintf(stderr, "ERROR: fail to close output file [%s].", outfname);
+        exit(32);
+      }
+      if (outfname)
+        free(outfname);
+    }
+  }
+
+  return 0;
+}

Modified: trunk/Build/source/texk/ptexenc/ptexenc/kanjicnv.h
===================================================================
--- trunk/Build/source/texk/ptexenc/ptexenc/kanjicnv.h	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/ptexenc/kanjicnv.h	2024-02-01 11:52:39 UTC (rev 69656)
@@ -20,6 +20,8 @@
 extern boolean isSJISkanji1(int c);
 extern boolean isSJISkanji2(int c);
 
+extern boolean isISO8859(int c);
+
 /* EUC <=> JIS X 0208 code conversion */
 extern int EUCtoJIS(int c);
 extern int JIStoEUC(int c);

Modified: trunk/Build/source/texk/ptexenc/ptexenc/ptexenc.h
===================================================================
--- trunk/Build/source/texk/ptexenc/ptexenc/ptexenc.h	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/ptexenc/ptexenc.h	2024-02-01 11:52:39 UTC (rev 69656)
@@ -100,6 +100,8 @@
 /* set current encoding */
 extern PTENCDLL boolean setinfileenc(FILE *fp, const char *str);
 extern PTENCDLL boolean setstdinenc(const char *str);
+extern PTENCDLL boolean setfileenc(const char *str);
+extern PTENCDLL char *ptenc_guess_enc(FILE *fp, boolean chk_bom);
 
 #ifdef WIN32
 extern PTENCDLL void clear_infile_enc(FILE *fp);

Modified: trunk/Build/source/texk/ptexenc/ptexenc.c
===================================================================
--- trunk/Build/source/texk/ptexenc/ptexenc.c	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/ptexenc.c	2024-02-01 11:52:39 UTC (rev 69656)
@@ -49,6 +49,7 @@
 static int     file_enc = ENC_UNKNOWN;
 static int internal_enc = ENC_UNKNOWN;
 static int terminal_enc = ENC_UNKNOWN;
+static int    guess_enc = ENC_UNKNOWN;
 
 const_string enc_to_string(int enc)
 {
@@ -73,12 +74,13 @@
     if (UPTEX_enabled && strcasecmp(str, "uptex")  == 0) return ENC_UPTEX;
 
     if (strcasecmp(str, "ASCII")== 0)        return file_enc;
-    if (strncasecmp(str, "AMBIGUOUS", 9) == 0) return file_enc;
+    if (strncasecmp(str, "AMBIGUOUS", 9) == 0) return guess_enc;
     if (strcasecmp(str, "BINARY") == 0)      return ENC_JIS;
     if (strcasecmp(str, "ISO-2022-JP") == 0) return ENC_JIS;
     if (strcasecmp(str, "EUC-JP") == 0)      return ENC_EUC;
     if (strcasecmp(str, "Shift_JIS")   == 0) return ENC_SJIS;
-    if (strcasecmp(str, "UTF-8")       == 0) return ENC_UTF8;
+    if (strncasecmp(str, "UTF-8", 5)   == 0) return ENC_UTF8;
+    if (strcasecmp(str, "ISO-8859") == 0)    return ENC_JIS;
     return -1; /* error */
 }
 
@@ -787,13 +789,14 @@
 }
 
 #define MARK_LEN 4
+static int bom_u[MARK_LEN] = { 0xEF, 0xBB, 0xBF, 0x7E };
+static int bom_l[MARK_LEN] = { 0xEF, 0xBB, 0xBF, 0x01 };
+
 /* if stream begins with BOM + 7bit char */
 static boolean isUTF8Nstream(FILE *fp)
 {
     int i;
     int c[MARK_LEN];
-    int bom_u[MARK_LEN] = { 0xEF, 0xBB, 0xBF, 0x7E };
-    int bom_l[MARK_LEN] = { 0xEF, 0xBB, 0xBF, 0x01 };
 
     for (i=0; i<MARK_LEN; i++) {
         c[i] = getc4(fp);
@@ -815,21 +818,28 @@
       No halfwidth katakana in Shift_JIS
       No SS2 nor SS3 in EUC-JP
       JIS X 0208 only and no platform dependent characters in Shift_JIS, EUC-JP
+      ISO-8859 may have 0xA0..0xFF, may not have 0x80..0x9F
 */
-char *ptenc_guess_enc(FILE *fp)
+char *ptenc_guess_enc(FILE *fp, boolean chk_bom)
 {
     char *enc;
     int k0, k1, k2, cdb[2], cu8[4], len_utf8;
     int is_ascii=1, lbyte=0;
-    int maybe_sjis=1, maybe_euc=1, maybe_utf8=1, pos_db=0, pos_utf8=0;
+    int maybe_sjis=1, maybe_euc=1, maybe_utf8=1, maybe_iso8859=1, pos_db=0, pos_utf8=0;
+    int ch_sjis=0, ch_euc=0, ch_utf8=0, ch_iso8859=0, bom=0;
 #ifdef DEBUG
     int i;
     unsigned char str0[5];
 #endif /* DEBUG */
-    enc = xmalloc(sizeof(char)*18);
+    enc = xmalloc(sizeof(char)*20);
 
     while ((k0 = fgetc(fp)) != EOF &&
-           (maybe_sjis+maybe_euc+maybe_utf8>1 || pos_db || pos_utf8)) {
+           (maybe_sjis+maybe_euc+maybe_utf8+maybe_iso8859>1 || pos_db || pos_utf8 || lbyte<200)) {
+        if (maybe_iso8859 && maybe_sjis+maybe_euc+maybe_utf8==1 && !pos_db && !pos_utf8
+            && ch_iso8859>=2000) {
+            break;
+        }
+        if (chk_bom && lbyte<4 && bom_l[lbyte] <= k0 && k0 <= bom_u[lbyte]) bom++;
         lbyte++;
         if (k0==ESC) {
             k0 = fgetc(fp);
@@ -871,8 +881,10 @@
                         fprintf(stderr, " not sjis\n");
                     }
 #endif /* DEBUG */
-                    if (k1)
+                    if (k1) {
+                        ch_sjis++;
                         continue;
+                    }
                 }
                 maybe_sjis = 0;
             }
@@ -883,6 +895,11 @@
             }
             continue;
         }
+
+        if (!isISO8859(k0))
+            maybe_iso8859 = 0;
+        else
+            ch_iso8859++;
         is_ascii = 0;
         if (pos_db==0) {
             cdb[0] = k0;
@@ -896,10 +913,14 @@
             if (maybe_sjis) {
                 if (!k1)
                     maybe_sjis = 0;
+                else
+                    ch_sjis++;
             }
             if (maybe_euc) {
                 if (!k2)
                     maybe_euc = 0;
+                else
+                    ch_euc++;
             }
             pos_db = 0;
 #ifdef DEBUG
@@ -941,7 +962,8 @@
             if (pos_utf8==1) {
                 if ((cu8[0]==0xE0 && cu8[1]<0xA0) ||
                     (cu8[0]==0xED && cu8[1]>0x9F) ||
-                    (cu8[0]==0xF0 && cu8[1]<0x90)) { /* illegal combination in UTF-8 */
+                    (cu8[0]==0xF0 && cu8[1]<0x90) ||
+                    (cu8[0]==0xF4 && cu8[1]>0x8F)) { /* illegal combination in UTF-8 */
                     maybe_utf8 = 0;
                     pos_utf8 = 0;
                     continue;
@@ -956,6 +978,7 @@
                 for (i=0; i<len_utf8; i++) fprintf(stderr, "%02X", cu8[i]);
                 fprintf(stderr, " U+%06lX (%s)\n", UTF8StoUCS(str0), str0);
 #endif /* DEBUG */
+                ch_utf8++;
                 len_utf8 = 0;
                 pos_utf8 = 0;
                 cu8[0]=cu8[1]=cu8[2]=cu8[3]=0;
@@ -967,24 +990,62 @@
         if (pos_db)   maybe_sjis = maybe_euc = 0;
         if (pos_utf8) maybe_utf8 = 0;
     }
+#ifdef DEBUG
+    if (maybe_sjis+maybe_euc+maybe_utf8+maybe_iso8859>1) {
+        fprintf(stderr,
+           "Maybe(%d, %d, %d, %d), Multibyte characters(%d, %d, %d, %d), lbyte(%d)\n",
+           maybe_sjis, maybe_euc, maybe_utf8, maybe_iso8859, ch_sjis, ch_euc, ch_utf8, ch_iso8859, lbyte);
+    }
+#endif /* DEBUG */
+    if (maybe_iso8859) {
+        /* The threshold of ch_* to judge ISO-8859 or not is heuristic, not strict */
+        if ((maybe_sjis && ch_sjis>=16 && ch_sjis*1.3<=ch_iso8859) ||
+            (maybe_euc  && ch_euc >=8  && ch_euc *2  ==ch_iso8859) ||
+            (maybe_utf8 && ch_utf8>=8  && ch_utf8*2  <=ch_iso8859) ||
+             bom==4)
+               maybe_iso8859 = 0;
+    }
     if (is_ascii)
         strcpy(enc,"ASCII");
-    else if (maybe_sjis+maybe_euc+maybe_utf8>1) {
+    else if (maybe_sjis+maybe_euc+maybe_utf8+maybe_iso8859>1) {
+        guess_enc = ENC_UNKNOWN;
         strcpy(enc,"AMBIGUOUS(");
-        if (maybe_sjis)
+        if (maybe_sjis) {
             enc = strcat(enc,"s");
-        if (maybe_euc)
+            if (file_enc == ENC_SJIS) guess_enc = ENC_SJIS;
+        }
+        if (maybe_euc) {
             enc = strcat(enc, maybe_sjis ? ",e" : "e");
-        if (maybe_utf8)
-            enc = strcat(enc, ",u");
+            if (file_enc == ENC_EUC)  guess_enc = ENC_EUC;
+        }
+        if (maybe_utf8) {
+            enc = strcat(enc, maybe_sjis || maybe_euc ? ",u" : "u");
+            if (file_enc == ENC_UTF8) guess_enc = ENC_UTF8;
+        }
+        if (maybe_iso8859)
+            enc = strcat(enc, ",i");
         enc = strcat(enc,")");
+        if (maybe_iso8859 && maybe_euc+maybe_sjis+maybe_utf8==1) {
+            if (maybe_sjis) guess_enc = ENC_SJIS;
+            if (maybe_euc)  guess_enc = ENC_EUC;
+            if (maybe_utf8) guess_enc = ENC_UTF8;
+        }
+#ifdef WIN32
+        if (guess_enc == ENC_UNKNOWN) guess_enc = ENC_UTF8;
+#else
+        if (guess_enc == ENC_UNKNOWN) guess_enc = get_terminal_enc();
+#endif
     }
     else if (maybe_sjis)
         strcpy(enc,"Shift_JIS");
     else if (maybe_euc)
         strcpy(enc,"EUC-JP");
-    else if (maybe_utf8)
+    else if (maybe_utf8) {
         strcpy(enc,"UTF-8");
+        if (bom>=3) strcat(enc," (BOM)");
+    }
+    else if (maybe_iso8859)
+        strcpy(enc,"ISO-8859");
     else
         strcpy(enc,"BINARY");
   post_process:
@@ -1041,7 +1102,7 @@
             getc4(fp);
             getc4(fp);
             rewind(fp);
-            enc = ptenc_guess_enc(fp);
+            enc = ptenc_guess_enc(fp, 0);
             if (string_to_enc(enc) > 0) {
                 infile_enc[fd] = string_to_enc(enc);
                 fprintf(stderr, "(guessed encoding #%d: %s = %s)", fd, enc, enc_to_string(infile_enc[fd]));
@@ -1145,6 +1206,15 @@
     return true;
 }
 
+boolean setfileenc(const char *str)
+{
+    int enc;
+    enc = string_to_enc(str);
+    if (enc < 0) return false;
+    file_enc = enc;
+    return true;
+}
+
 #ifdef WIN32
 void clear_infile_enc(FILE *fp)
 {

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-euc
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-euc	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-euc	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,13 @@
+% ambiguous: UTF-8 or EUC-JP
+ at Type{ambiguos-a001, field = {C2Ax: \xA1\xF1\xA1\xF2\xA1\xEF\xA1\xF8\xA1\xAF\xA2\xCC}, }
+ at Type{ambiguos-a002, field = {C2Bx: \xA1\xEB\xA1ޢ\xF9\xA1\xE0}, }
+ at Type{ambiguos-a005, field = {CEAx: \xA6\xB1\xA6\xB2\xA6\xB3\xA6\xB4\xA6\xB5\xA6\xB6\xA6\xB7\xA6\xB8}, }
+ at Type{ambiguos-a006, field = {CEBx: \xA6\xC1\xA6¦æĦŦƦǦȦɦʦ˦̦ͦΦ\xCF}, }
+ at Type{ambiguos-a007, field = {D0Ax: \xA7\xB3\xA7\xB4\xA7\xB5\xA7\xB6\xA7\xB7\xA7\xB8\xA7\xB9\xA7\xBA\xA7\xBB\xA7\xBC\xA7\xBD\xA7\xBE\xA7\xBF\xA7\xC0\xA7\xC1}, }
+ at Type{ambiguos-a008, field = {D0Bx: \xA7ѧҧӧԧէ֧ا٧ڧۧܧݧާߧ\xE0\xA7\xE1}, }
+ at Type{ambiguos-a009, field = {\xB2¿\xCD \xC2\xE7\xC0\xBC ˴\xBC\xBA \xC2в\xC1 \xCDĽ\xF7 \xB5\xA2Ǥ \xBF\xAE\xB6\xC4 ȼη \xBB\xB3\xB3\xD9 ǯ\xCA\xF0 ʿ\xBE\xEF \xB1\xE4\xBF\xAD \xCF\xC9\xC2\xEB}, }
+ at Type{ambiguos-a011, field = {F0A3B3BE:  }, }
+ at Type{ambiguos-a012, field = {F0A5B6A1:  }, }
+ at Type{ambiguos-a013, field = {F0A1B6B7:  }, }
+ at Type{ambiguos-a020, field = {\xA6\xCE\xA6\xB8 \xA6\xB4\xA6\xB5     \xA7\xB9 \xA7\xB3\xA7\xD2     \xA1\xEB}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-euc-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-euc-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-euc-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,13 @@
+% ambiguous: UTF-8 or EUC-JP
+ at Type{ambiguos-a001, field = {C2Ax: 蔵贈促則即測}, }
+ at Type{ambiguos-a002, field = {C2Bx: 属賊其歎}, }
+ at Type{ambiguos-a005, field = {CEAx: 痢裡里離陸律率立}, }
+ at Type{ambiguos-a006, field = {CEBx: 留硫粒隆竜龍侶慮旅虜了亮僚両凌}, }
+ at Type{ambiguos-a007, field = {D0Ax: 弌丐丕个丱丶丼丿乂乖乘亂亅豫亊}, }
+ at Type{ambiguos-a008, field = {D0Bx: 舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗}, }
+ at Type{ambiguos-a009, field = {篏割査 紊у0 篋≦け 絲鞘勝 綛弱コ 絽遺算 篆>三 篌岩抄 絮怨桶 綛岩晋 綛喝幻 綮銀叱 薹臥傾}, }
+ at Type{ambiguos-a011, field = {F0A3B3BE: 陦馨}, }
+ at Type{ambiguos-a012, field = {F0A5B6A1: 陬供}, }
+ at Type{ambiguos-a013, field = {F0A1B6B7: 陝況}, }
+ at Type{ambiguos-a020, field = {両立 離陸 速達 天丼 弌弍 略奪 尊属}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-jis
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-jis	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-jis	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,13 @@
+% ambiguous: UTF-8 or EUC-JP
+ at Type{ambiguos-a001, field = {C2Ax: $B!q!r!o!x!/"L(B}, }
+ at Type{ambiguos-a002, field = {C2Bx: $B!k!^"y!`(B}, }
+ at Type{ambiguos-a005, field = {CEAx: $B&1&2&3&4&5&6&7&8(B}, }
+ at Type{ambiguos-a006, field = {CEBx: $B&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O(B}, }
+ at Type{ambiguos-a007, field = {D0Ax: $B'3'4'5'6'7'8'9':';'<'='>'?'@'A(B}, }
+ at Type{ambiguos-a008, field = {D0Bx: $B'Q'R'S'T'U'V'X'Y'Z'['\']'^'_'`'a(B}, }
+ at Type{ambiguos-a009, field = {$B2B?M(B $BBg@<(B $BK4<:(B $BBP2A(B $BMD=w(B $B5"G$(B $B?.6D(B $BH<N7(B $B;33Y(B $BG/Jp(B $BJ?>o(B $B1d?-(B $BOIBk(B}, }
+ at Type{ambiguos-a011, field = {F0A3B3BE: $B (B}, }
+ at Type{ambiguos-a012, field = {F0A5B6A1: $B (B}, }
+ at Type{ambiguos-a013, field = {F0A1B6B7: $B (B}, }
+ at Type{ambiguos-a020, field = {$B&N&8(B $B&4&5(B $B  (B $B '9(B $B'3'R(B $B  (B $B !k(B}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-sjis
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-sjis	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-sjis	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,13 @@
+% ambiguous: UTF-8 or EUC-JP
+ at Type{ambiguos-a001, field = {C2Ax: \x81\x91\x81\x92\x81\x8F\x81\x98\x81N\x81\xCA}, }
+ at Type{ambiguos-a002, field = {C2Bx: \x81\x8B\x81}\x81\xF7\x81\x80}, }
+ at Type{ambiguos-a005, field = {CEAx: \x83\xAF\x83\xB0\x83\xB1\x83\xB2\x83\xB3\x83\xB4\x83\xB5\x83\xB6}, }
+ at Type{ambiguos-a006, field = {CEBx: \x83\xBF\x83\xC0\x83\xC1\x83ƒÃăŃƃǃȃɃʃ˃̃\xCD}, }
+ at Type{ambiguos-a007, field = {D0Ax: \x84R\x84S\x84T\x84U\x84V\x84W\x84X\x84Y\x84Z\x84[\x84\\x84]\x84^\x84_\x84`}, }
+ at Type{ambiguos-a008, field = {D0Bx: \x84p\x84q\x84r\x84s\x84t\x84u\x84w\x84x\x84y\x84z\x84{\x84|\x84}\x84~\x84\x80\x84\x81}, }
+ at Type{ambiguos-a009, field = {\x89\xC0\x90l \x91\xE5\x90\xBA \x96S\x8E\xB8 \x91\xCE\x89\xBF \x97c\x8F\x97 \x8BA\x94C \x90M\x8B\xC2 \x94\xBA\x97\xB5 \x8ER\x8Ax \x94N\x95\xEE \x95\xBD\x8F\xED \x89\x84\x90L \x98h\x91\xE9}, }
+ at Type{ambiguos-a011, field = {F0A3B3BE:  }, }
+ at Type{ambiguos-a012, field = {F0A5B6A1:  }, }
+ at Type{ambiguos-a013, field = {F0A1B6B7:  }, }
+ at Type{ambiguos-a020, field = {\x83\xCC\x83\xB6 \x83\xB2\x83\xB3     \x84X \x84R\x84q     \x81\x8B}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-sjis-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-sjis-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-sjis-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,5 @@
+% ambiguous: UTF-8 or Shift_JIS
+ at Type{ambiguos-a050, field = {菫R菴土}, }
+ at Type{ambiguos-a051, field = {隱樞蔵隱壺贈}, }
+ at Type{ambiguos-a052, field = {諤晄Φ 謇鍋帥 譏取枚 蝙ら峩 諤懈ぉ}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb0.bib-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,13 @@
+% ambiguous: UTF-8 or EUC-JP
+ at Type{ambiguos-a001, field = {C2Ax: ¢£¥§¨¬}, }
+ at Type{ambiguos-a002, field = {C2Bx: °±¶÷}, }
+ at Type{ambiguos-a005, field = {CEAx: ΡΣΤΥΦΧΨΩ}, }
+ at Type{ambiguos-a006, field = {CEBx: αβγδεζηθικλμνξο}, }
+ at Type{ambiguos-a007, field = {D0Ax: СТУФХЦЧШЩЪЫЬЭЮЯ}, }
+ at Type{ambiguos-a008, field = {D0Bx: абвгдежзийклмноп}, }
+ at Type{ambiguos-a009, field = {佳人 大声 亡失 対価 幼女 帰任 信仰 伴侶 山岳 年俸 平常 延伸 鷲鷹}, }
+ at Type{ambiguos-a011, field = {F0A3B3BE: 𣳾}, }
+ at Type{ambiguos-a012, field = {F0A5B6A1: 𥶡}, }
+ at Type{ambiguos-a013, field = {F0A1B6B7: 𡶷}, }
+ at Type{ambiguos-a020, field = {ξΩ ΥΦ ®ã ŷЧ Сб άå º°}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-euc
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-euc	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-euc	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,5 @@
+% ambiguous: UTF-8 or Shift_JIS
+ at Type{ambiguos-a050, field = {\xB7\xB8q\xC2\xCEy}, }
+ at Type{ambiguos-a051, field = {\xB8\xEC \xEB\xD7 }, }
+ at Type{ambiguos-a052, field = {\xBB\xD7\xC1\xDB \xC2ǵ\xE5 \xCC\xC0ʸ \xBF\xE2ľ \xCE\xE7ئ}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-jis
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-jis	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-jis	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,5 @@
+% ambiguous: UTF-8 or Shift_JIS
+ at Type{ambiguos-a050, field = {$B78(Bq$BBN(By}, }
+ at Type{ambiguos-a051, field = {$B8l kW (B}, }
+ at Type{ambiguos-a052, field = {$B;WA[(B $BBG5e(B $BL at J8(B $B?bD>(B $BNgX&(B}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-sjis
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-sjis	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-sjis	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,5 @@
+% ambiguous: UTF-8 or Shift_JIS
+ at Type{ambiguos-a050, field = {\x8CWq\x91\xCCy}, }
+ at Type{ambiguos-a051, field = {\x8C\xEA \xE6v }, }
+ at Type{ambiguos-a052, field = {\x8Ev\x91z \x91\xC5\x8B\x85 \x96\xBE\x95\xB6 \x90\x82\x92\xBC \x97\xE5\x9C\xA4}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-sjis-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-sjis-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-sjis-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,5 @@
+% ambiguous: UTF-8 or Shift_JIS
+ at Type{ambiguos-a050, field = {菫R菴土}, }
+ at Type{ambiguos-a051, field = {隱樞蔵隱壺贈}, }
+ at Type{ambiguos-a052, field = {諤晄Φ 謇鍋帥 譏取枚 蝙ら峩 諤懈ぉ}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb1.bib-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,5 @@
+% ambiguous: UTF-8 or Shift_JIS
+ at Type{ambiguos-a050, field = {係q体y}, }
+ at Type{ambiguos-a051, field = {語①誚②}, }
+ at Type{ambiguos-a052, field = {思想 打球 明文 垂直 怜悧}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb2.bib-euc-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb2.bib-euc-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb2.bib-euc-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,13 @@
+% ambiguous: EUC-JP or Shift_JIS
+ at Type{ambiguos-a100, field = {E0Ax: 燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆}, }
+ at Type{ambiguos-a101, field = {E2Ax: 癲癶癸發皀皃皈皋皎皖皓皙皚皰皴}, }
+ at Type{ambiguos-a102, field = {E4Ax: 筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝}, }
+ at Type{ambiguos-a103, field = {E6Ax: 罅罌罍罎罐网罕罔罘罟罠罨罩罧罸}, }
+ at Type{ambiguos-a104, field = {E8Ax: 茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚}, }
+ at Type{ambiguos-a105, field = {EAAx: 蝓蝣蝪蠅}, }
+ at Type{ambiguos-a106, field = {coffee: 珈琲 獻琥}, }
+ at Type{ambiguos-a107, field = {amber: 琥珀 琅珎}, }
+ at Type{ambiguos-a108, field = {dotage: 耄碌 稾瘴}, }
+ at Type{ambiguos-a109, field = {konjak: 蒟蒻 粤粫}, }
+ at Type{ambiguos-a110, field = {rampant: 猖獗 猊獏}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-amb2.bib-sjis-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-amb2.bib-sjis-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-amb2.bib-sjis-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,13 @@
+% ambiguous: EUC-JP or Shift_JIS
+ at Type{ambiguos-a100, field = {E0Ax: 爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘}, }
+ at Type{ambiguos-a101, field = {E2Ax: 筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟}, }
+ at Type{ambiguos-a102, field = {E4Ax: 茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟}, }
+ at Type{ambiguos-a103, field = {E6Ax: 譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈}, }
+ at Type{ambiguos-a104, field = {E8Ax: 陦陲陬隍隘隕隗險隧隱隲隰隴隶隸}, }
+ at Type{ambiguos-a105, field = {EAAx: 遙瑤凜熙}, }
+ at Type{ambiguos-a106, field = {coffee: 珎瑕 珈琲}, }
+ at Type{ambiguos-a107, field = {amber: 琲珮 琥珀}, }
+ at Type{ambiguos-a108, field = {dotage: 賽糂 耄碌}, }
+ at Type{ambiguos-a109, field = {konjak: 韈韭 蒟蒻}, }
+ at Type{ambiguos-a110, field = {rampant: 猴獨 猖獗}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-euc.bib-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-euc.bib-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-euc.bib-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,5 @@
+ at Type{ascii-e001, field = {ABC xyz}, }
+ at Type{greek-e001, field = {ΑΒΓ χψω}, }
+ at Type{cyrillic-e001, field = {АБВ эюя}, }
+ at Type{kana-e001, field = {あいうえお}, }
+ at Type{hanzi-e001, field = {一二三四五}, }

Added: trunk/Build/source/texk/ptexenc/tests/enc-jis.bib-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-jis.bib-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-jis.bib-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,5 @@
+ at Type{ascii-j001, field = {ABC xyz}, }
+ at Type{greek-j001, field = {ΑΒΓ χψω}, }
+ at Type{cyrillic-j001, field = {АБВ эюя}, }
+ at Type{kana-j001, field = {あいうえお}, }
+ at Type{hanzi-j001, field = {一二三四五}, }

Added: trunk/Build/source/texk/ptexenc/tests/enc-sjis.bib-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-sjis.bib-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-sjis.bib-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,5 @@
+ at Type{ascii-s001, field = {ABC xyz}, }
+ at Type{greek-s001, field = {ΑΒΓ χψω}, }
+ at Type{cyrillic-s001, field = {АБВ эюя}, }
+ at Type{kana-s001, field = {あいうえお}, }
+ at Type{hanzi-s001, field = {一二三四五}, }

Added: trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-euc
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-euc	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-euc	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,6 @@
+ at Type{ascii-u001, field = {ABC xyz}, }
+ at Type{greek-u001, field = {\xA6\xA1\xA6\xA2\xA6\xA3 \xA6֦צ\xD8}, }
+ at Type{cyrillic-u001, field = {\xA7\xA1\xA7\xA2\xA7\xA3 \xA7\xEF\xA7\xF0\xA7\xF1}, }
+ at Type{kana-u001, field = {\xA4\xA2\xA4\xA4\xA4\xA6\xA4\xA8\xA4\xAA}, }
+ at Type{kana-u002, field = {\xA5ϥϥХХѥ\xD1}, }
+ at Type{hanzi-u001, field = {\xB0\xEC\xC6󻰻͸\xDE}, }

Added: trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-jis
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-jis	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-jis	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,6 @@
+ at Type{ascii-u001, field = {ABC xyz}, }
+ at Type{greek-u001, field = {$B&!&"&#(B $B&V&W&X(B}, }
+ at Type{cyrillic-u001, field = {$B'!'"'#(B $B'o'p'q(B}, }
+ at Type{kana-u001, field = {$B$"$$$&$($*(B}, }
+ at Type{kana-u002, field = {$B%O%O%P%P%Q%Q(B}, }
+ at Type{hanzi-u001, field = {$B0lFs;0;M8^(B}, }

Added: trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-sjis
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-sjis	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-sjis	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,6 @@
+ at Type{ascii-u001, field = {ABC xyz}, }
+ at Type{greek-u001, field = {\x83\x9F\x83\xA0\x83\xA1 \x83ԃՃ\xD6}, }
+ at Type{cyrillic-u001, field = {\x84@\x84A\x84B \x84\x8F\x84\x90\x84\x91}, }
+ at Type{kana-u001, field = {\x82\xA0\x82\xA2\x82\xA4\x82\xA6\x82\xA8}, }
+ at Type{kana-u002, field = {\x83n\x83n\x83o\x83o\x83p\x83p}, }
+ at Type{hanzi-u001, field = {\x88\xEA\x93\xF1\x8EO\x8El\x8C\xDC}, }

Copied: trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-utf8 (from rev 69645, trunk/Build/source/texk/web2c/tests/enc-utf8.bib)
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8.bib-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,6 @@
+ at Type{ascii-u001, field = {ABC xyz}, }
+ at Type{greek-u001, field = {ΑΒΓ χψω}, }
+ at Type{cyrillic-u001, field = {АБВ эюя}, }
+ at Type{kana-u001, field = {あいうえお}, }
+ at Type{kana-u002, field = {ハハババパパ}, }
+ at Type{hanzi-u001, field = {一二三四五}, }

Added: trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-euc
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-euc	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-euc	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,6 @@
+% UTF-8 with BOM
+ at Type{ascii-v001, field = {ABC xyz}, }
+ at Type{ambiguos-v050, field = {\xB7\xB8q\xC2\xCEy}, }
+ at Type{ambiguos-v051, field = {\xB8\xEC \xEB\xD7 }, }
+ at Type{ambiguos-v052, field = {\xBB\xD7\xC1\xDB \xC2ǵ\xE5 \xCC\xC0ʸ \xBF\xE2ľ \xCE\xE7ئ}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-jis
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-jis	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-jis	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,6 @@
+% UTF-8 with BOM
+ at Type{ascii-v001, field = {ABC xyz}, }
+ at Type{ambiguos-v050, field = {$B78(Bq$BBN(By}, }
+ at Type{ambiguos-v051, field = {$B8l kW (B}, }
+ at Type{ambiguos-v052, field = {$B;WA[(B $BBG5e(B $BL at J8(B $B?bD>(B $BNgX&(B}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-sjis
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-sjis	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-sjis	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,6 @@
+% UTF-8 with BOM
+ at Type{ascii-v001, field = {ABC xyz}, }
+ at Type{ambiguos-v050, field = {\x8CWq\x91\xCCy}, }
+ at Type{ambiguos-v051, field = {\x8C\xEA \xE6v }, }
+ at Type{ambiguos-v052, field = {\x8Ev\x91z \x91\xC5\x8B\x85 \x96\xBE\x95\xB6 \x90\x82\x92\xBC \x97\xE5\x9C\xA4}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8a.bib-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,6 @@
+% UTF-8 with BOM
+ at Type{ascii-v001, field = {ABC xyz}, }
+ at Type{ambiguos-v050, field = {係q体y}, }
+ at Type{ambiguos-v051, field = {語①誚②}, }
+ at Type{ambiguos-v052, field = {思想 打球 明文 垂直 怜悧}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-euc
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-euc	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-euc	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,7 @@
+% UTF-8 with BOM
+ at Type{ascii-v002, field = {ABC xyz}, }
+ at Type{ambiguos-v003, field = {C2Ax: \xA1\xF1\xA1\xF2\xA1\xEF\xA1\xF8\xA1\xAF\xA2\xCC}, }
+ at Type{ambiguos-v006, field = {CEBx: \xA6\xC1\xA6¦æĦŦƦǦȦɦʦ˦̦ͦΦ\xCF}, }
+ at Type{ambiguos-v008, field = {D0Bx: \xA7ѧҧӧԧէ֧ا٧ڧۧܧݧާߧ\xE0\xA7\xE1}, }
+ at Type{ambiguos-v009, field = {\xB2¿\xCD \xC2\xE7\xC0\xBC ˴\xBC\xBA \xC2в\xC1 \xCDĽ\xF7 \xB5\xA2Ǥ \xBF\xAE\xB6\xC4 ȼη \xBB\xB3\xB3\xD9 ǯ\xCA\xF0 ʿ\xBE\xEF \xB1\xE4\xBF\xAD \xCF\xC9\xC2\xEB}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-jis
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-jis	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-jis	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,7 @@
+% UTF-8 with BOM
+ at Type{ascii-v002, field = {ABC xyz}, }
+ at Type{ambiguos-v003, field = {C2Ax: $B!q!r!o!x!/"L(B}, }
+ at Type{ambiguos-v006, field = {CEBx: $B&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O(B}, }
+ at Type{ambiguos-v008, field = {D0Bx: $B'Q'R'S'T'U'V'X'Y'Z'['\']'^'_'`'a(B}, }
+ at Type{ambiguos-v009, field = {$B2B?M(B $BBg@<(B $BK4<:(B $BBP2A(B $BMD=w(B $B5"G$(B $B?.6D(B $BH<N7(B $B;33Y(B $BG/Jp(B $BJ?>o(B $B1d?-(B $BOIBk(B}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-sjis
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-sjis	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-sjis	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,7 @@
+% UTF-8 with BOM
+ at Type{ascii-v002, field = {ABC xyz}, }
+ at Type{ambiguos-v003, field = {C2Ax: \x81\x91\x81\x92\x81\x8F\x81\x98\x81N\x81\xCA}, }
+ at Type{ambiguos-v006, field = {CEBx: \x83\xBF\x83\xC0\x83\xC1\x83ƒÃăŃƃǃȃɃʃ˃̃\xCD}, }
+ at Type{ambiguos-v008, field = {D0Bx: \x84p\x84q\x84r\x84s\x84t\x84u\x84w\x84x\x84y\x84z\x84{\x84|\x84}\x84~\x84\x80\x84\x81}, }
+ at Type{ambiguos-v009, field = {\x89\xC0\x90l \x91\xE5\x90\xBA \x96S\x8E\xB8 \x91\xCE\x89\xBF \x97c\x8F\x97 \x8BA\x94C \x90M\x8B\xC2 \x94\xBA\x97\xB5 \x8ER\x8Ax \x94N\x95\xEE \x95\xBD\x8F\xED \x89\x84\x90L \x98h\x91\xE9}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-utf8
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-utf8	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/enc-utf8b.bib-utf8	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,7 @@
+% UTF-8 with BOM
+ at Type{ascii-v002, field = {ABC xyz}, }
+ at Type{ambiguos-v003, field = {C2Ax: ¢£¥§¨¬}, }
+ at Type{ambiguos-v006, field = {CEBx: αβγδεζηθικλμνξο}, }
+ at Type{ambiguos-v008, field = {D0Bx: абвгдежзийклмноп}, }
+ at Type{ambiguos-v009, field = {佳人 大声 亡失 対価 幼女 帰任 信仰 伴侶 山岳 年俸 平常 延伸 鷲鷹}, }
+

Added: trunk/Build/source/texk/ptexenc/tests/ptekf-conv.test
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/ptekf-conv.test	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/ptekf-conv.test	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,77 @@
+#! /bin/sh -vx
+# $Id$
+# Copyright 2024 Japanese TeX Development Community <issue at texjp.org>
+# You may freely use, modify and/or distribute this file.
+
+# Not really a test, just making sure the program executes.
+
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_ptekf=$BinDir/ptekf$ExeExt
+
+TEXMFCNF=$srcdir/../kpathsea
+web2cdir=$srcdir/../web2c
+
+export TEXMFCNF
+
+rm -f ./enc-*.bib.out*
+
+cp $web2cdir/tests/enc-*.bib .
+
+for sfx in amb0 amb1 euc jis sjis utf8 utf8a utf8b; do
+
+  $_ptekf --guess -u ./enc-$sfx.bib
+  diff enc-$sfx.bib.out $srcdir/tests/enc-$sfx.bib-utf8 || exit 1
+  $_ptekf --guess --buffer ./enc-$sfx.bib
+  diff enc-$sfx.bib.out $srcdir/tests/enc-$sfx.bib-utf8 || exit 2
+  if [ $sfx = euc ]; then
+    $_ptekf -E -u ./enc-$sfx.bib
+    diff enc-$sfx.bib.out $srcdir/tests/enc-$sfx.bib-utf8 || exit 3
+  fi
+  if [ $sfx = jis ]; then
+    $_ptekf -J -u ./enc-$sfx.bib
+    diff enc-$sfx.bib.out $srcdir/tests/enc-$sfx.bib-utf8 || exit 4
+  fi
+  if [ $sfx = sjis ]; then
+    $_ptekf -S -u ./enc-$sfx.bib
+    diff enc-$sfx.bib.out $srcdir/tests/enc-$sfx.bib-utf8 || exit 5
+  fi
+
+done
+
+for sfx in amb0 amb1 utf8 utf8a utf8b; do
+
+  $_ptekf -U -b ./enc-$sfx.bib
+  mv enc-$sfx.bib.out enc-$sfx.bib.out-buf
+  diff enc-$sfx.bib.out-buf $srcdir/tests/enc-$sfx.bib-utf8 || exit 11
+  $_ptekf -U -e ./enc-$sfx.bib
+  mv enc-$sfx.bib.out enc-$sfx.bib.out-euc
+  diff enc-$sfx.bib.out-euc $srcdir/tests/enc-$sfx.bib-euc || exit 12
+  $_ptekf -U -j ./enc-$sfx.bib
+  mv enc-$sfx.bib.out enc-$sfx.bib.out-jis
+  diff enc-$sfx.bib.out-jis $srcdir/tests/enc-$sfx.bib-jis || exit 13
+  $_ptekf -U -s ./enc-$sfx.bib
+  mv enc-$sfx.bib.out enc-$sfx.bib.out-sjis
+  diff enc-$sfx.bib.out-sjis $srcdir/tests/enc-$sfx.bib-sjis || exit 14
+
+done
+
+for sfx in amb0 amb2; do
+
+  $_ptekf -E -u ./enc-$sfx.bib
+  diff enc-$sfx.bib.out $srcdir/tests/enc-$sfx.bib-euc-utf8 || exit 21
+  $_ptekf -E --buffer ./enc-$sfx.bib
+  diff enc-$sfx.bib.out $srcdir/tests/enc-$sfx.bib-euc-utf8 || exit 22
+
+done
+
+for sfx in amb1 amb2; do
+
+  cp $web2cdir/tests/enc-$sfx.bib .
+
+  $_ptekf -S -u ./enc-$sfx.bib
+  diff enc-$sfx.bib.out $srcdir/tests/enc-$sfx.bib-sjis-utf8 || exit 23
+  $_ptekf -S --buffer ./enc-$sfx.bib
+  diff enc-$sfx.bib.out $srcdir/tests/enc-$sfx.bib-sjis-utf8 || exit 24
+
+done


Property changes on: trunk/Build/source/texk/ptexenc/tests/ptekf-conv.test
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Build/source/texk/ptexenc/tests/ptekf-guess.test
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/ptekf-guess.test	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/ptekf-guess.test	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,20 @@
+#! /bin/sh -v
+# $Id$
+# Copyright 2024 Japanese TeX Development Community <issue at texjp.org>
+# You may freely use, modify and/or distribute this file.
+
+# Not really a test, just making sure the program executes.
+
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_ptekf=$BinDir/ptekf$ExeExt
+
+TEXMFCNF=$srcdir/../kpathsea
+web2cdir=$srcdir/../web2c
+bibtexxdir=$srcdir/../bibtex-x
+
+export TEXMFCNF
+
+
+$_ptekf --guess $web2cdir/tests/*.bib || exit 1
+$_ptekf --guess $bibtexxdir/tests/*.bib || exit 2


Property changes on: trunk/Build/source/texk/ptexenc/tests/ptekf-guess.test
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Build/source/texk/ptexenc/tests/ptekf-smoke.test
===================================================================
--- trunk/Build/source/texk/ptexenc/tests/ptekf-smoke.test	                        (rev 0)
+++ trunk/Build/source/texk/ptexenc/tests/ptekf-smoke.test	2024-02-01 11:52:39 UTC (rev 69656)
@@ -0,0 +1,14 @@
+#! /bin/sh
+# $Id$
+# Copyright 2024 Japanese TeX Development Community <issue at texjp.org>
+# You may freely use, modify and/or distribute this file.
+
+# Not really a test, just making sure the program executes.
+
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_ptekf=$BinDir/ptekf$ExeExt
+
+$_ptekf --version || exit 1
+echo ''
+$_ptekf --help || exit 2


Property changes on: trunk/Build/source/texk/ptexenc/tests/ptekf-smoke.test
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: trunk/Build/source/texk/ptexenc/version.ac
===================================================================
--- trunk/Build/source/texk/ptexenc/version.ac	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/ptexenc/version.ac	2024-02-01 11:52:39 UTC (rev 69656)
@@ -1,5 +1,5 @@
 dnl $Id$
-dnl   Copyright 2022-2023 Japanese TeX Development Community <issue at texjp.org>
+dnl   Copyright 2022-2024 Japanese TeX Development Community <issue at texjp.org>
 dnl   Copyright 2016-2022 Karl Berry <tex-live at tug.org>
 dnl   Copyright 2011-2015 Peter Breitenlohner <tex-live at tug.org>
 dnl
@@ -11,4 +11,4 @@
 dnl see kpathsea/version.ac.
 dnl
 dnl This file is m4-included from configure.ac.
-m4_define([ptexenc_version], [1.4.4/dev])
+m4_define([ptexenc_version], [1.4.5/dev])

Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/web2c/ChangeLog	2024-02-01 11:52:39 UTC (rev 69656)
@@ -1,3 +1,9 @@
+2024-02-01  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* tests/enc-utf8.bib, tests/enc-{,e,s}[pu].bbl:
+	Add tests for guess encodings & upBibTeX &
+	Kana (semi)voiced sounds.
+
 2023-12-24  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* tests/fn-generate.perl:

Modified: trunk/Build/source/texk/web2c/tests/enc-ep.bbl
===================================================================
--- trunk/Build/source/texk/web2c/tests/enc-ep.bbl	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/web2c/tests/enc-ep.bbl	2024-02-01 11:52:39 UTC (rev 69656)
@@ -33,6 +33,7 @@
 \item \xA4\xA2\xA4\xA4\xA4\xA6\xA4\xA8\xA4\xAA
 \item \xA4\xA2\xA4\xA4\xA4\xA6\xA4\xA8\xA4\xAA
 \item \xA4\xA2\xA4\xA4\xA4\xA6\xA4\xA8\xA4\xAA
+\item \xA5ϥϥХХѥ\xD1
 \item \xA6\xA1\xA6\xA2\xA6\xA3 \xA6֦צ\xD8
 \item \xA6\xA1\xA6\xA2\xA6\xA3 \xA6֦צ\xD8
 \item \xA6\xA1\xA6\xA2\xA6\xA3 \xA6֦צ\xD8

Modified: trunk/Build/source/texk/web2c/tests/enc-eu.bbl
===================================================================
--- trunk/Build/source/texk/web2c/tests/enc-eu.bbl	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/web2c/tests/enc-eu.bbl	2024-02-01 11:52:39 UTC (rev 69656)
@@ -41,6 +41,7 @@
 \item \xA4\xA2\xA4\xA4\xA4\xA6\xA4\xA8\xA4\xAA
 \item \xA4\xA2\xA4\xA4\xA4\xA6\xA4\xA8\xA4\xAA
 \item \xA4\xA2\xA4\xA4\xA4\xA6\xA4\xA8\xA4\xAA
+\item \xA5ϥϥХХѥ\xD1
 \item \xB0\xEC\xC6󻰻͸\xDE
 \item \xB0\xEC\xC6󻰻͸\xDE
 \item \xB0\xEC\xC6󻰻͸\xDE

Modified: trunk/Build/source/texk/web2c/tests/enc-p.bbl
===================================================================
--- trunk/Build/source/texk/web2c/tests/enc-p.bbl	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/web2c/tests/enc-p.bbl	2024-02-01 11:52:39 UTC (rev 69656)
@@ -39,6 +39,7 @@
 \item あいうえお
 \item あいうえお
 \item あいうえお
+\item ハハババパパ
 \item ΑΒΓ χψω
 \item ΑΒΓ χψω
 \item ΑΒΓ χψω

Modified: trunk/Build/source/texk/web2c/tests/enc-sp.bbl
===================================================================
--- trunk/Build/source/texk/web2c/tests/enc-sp.bbl	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/web2c/tests/enc-sp.bbl	2024-02-01 11:52:39 UTC (rev 69656)
@@ -21,6 +21,7 @@
 \item \x82\xA0\x82\xA2\x82\xA4\x82\xA6\x82\xA8
 \item \x82\xA0\x82\xA2\x82\xA4\x82\xA6\x82\xA8
 \item \x82\xA0\x82\xA2\x82\xA4\x82\xA6\x82\xA8
+\item \x83n\x83n\x83o\x83o\x83p\x83p
 \item \x83\x9F\x83\xA0\x83\xA1 \x83ԃՃ\xD6
 \item \x83\x9F\x83\xA0\x83\xA1 \x83ԃՃ\xD6
 \item \x83\x9F\x83\xA0\x83\xA1 \x83ԃՃ\xD6

Modified: trunk/Build/source/texk/web2c/tests/enc-su.bbl
===================================================================
--- trunk/Build/source/texk/web2c/tests/enc-su.bbl	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/web2c/tests/enc-su.bbl	2024-02-01 11:52:39 UTC (rev 69656)
@@ -29,6 +29,7 @@
 \item \x82\xA0\x82\xA2\x82\xA4\x82\xA6\x82\xA8
 \item \x82\xA0\x82\xA2\x82\xA4\x82\xA6\x82\xA8
 \item \x82\xA0\x82\xA2\x82\xA4\x82\xA6\x82\xA8
+\item \x83n\x83n\x83o\x83o\x83p\x83p
 \item \x88\xEA\x93\xF1\x8EO\x8El\x8C\xDC
 \item \x88\xEA\x93\xF1\x8EO\x8El\x8C\xDC
 \item \x88\xEA\x93\xF1\x8EO\x8El\x8C\xDC

Modified: trunk/Build/source/texk/web2c/tests/enc-u.bbl
===================================================================
--- trunk/Build/source/texk/web2c/tests/enc-u.bbl	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/web2c/tests/enc-u.bbl	2024-02-01 11:52:39 UTC (rev 69656)
@@ -48,6 +48,7 @@
 \item あいうえお
 \item あいうえお
 \item あいうえお
+\item ハハババパパ
 \item 一二三四五
 \item 一二三四五
 \item 一二三四五

Modified: trunk/Build/source/texk/web2c/tests/enc-up.bbl
===================================================================
--- trunk/Build/source/texk/web2c/tests/enc-up.bbl	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/web2c/tests/enc-up.bbl	2024-02-01 11:52:39 UTC (rev 69656)
@@ -19,6 +19,7 @@
 \item F0A5B6A1: ^^f0^^a5^^b6^^a1
 \item あいうえお
 \item あいうえお
+\item ハハババパパ
 \item ΑΒΓ χψω
 \item ΑΒΓ χψω
 \item ξΩ ΥΦ ^^c2^^ae^^c3^^a3 ^^c5^^b7Ч Сб ^^ce^^ac^^c3^^a5 ^^c2^^ba°

Modified: trunk/Build/source/texk/web2c/tests/enc-utf8.bib
===================================================================
--- trunk/Build/source/texk/web2c/tests/enc-utf8.bib	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/web2c/tests/enc-utf8.bib	2024-02-01 11:52:39 UTC (rev 69656)
@@ -2,4 +2,5 @@
 @Type{greek-u001, field = {ΑΒΓ χψω}, }
 @Type{cyrillic-u001, field = {АБВ эюя}, }
 @Type{kana-u001, field = {あいうえお}, }
+ at Type{kana-u002, field = {ハハババパパ}, }
 @Type{hanzi-u001, field = {一二三四五}, }

Modified: trunk/Build/source/texk/web2c/tests/enc-uu.bbl
===================================================================
--- trunk/Build/source/texk/web2c/tests/enc-uu.bbl	2024-02-01 00:43:41 UTC (rev 69655)
+++ trunk/Build/source/texk/web2c/tests/enc-uu.bbl	2024-02-01 11:52:39 UTC (rev 69656)
@@ -24,6 +24,7 @@
 \item АБВ эюя
 \item あいうえお
 \item あいうえお
+\item ハハババパパ
 \item 一二三四五
 \item 一二三四五
 \item



More information about the tex-live-commits mailing list.