summaryrefslogtreecommitdiff
path: root/biblio/bibtex/bibtex-x/tests
diff options
context:
space:
mode:
Diffstat (limited to 'biblio/bibtex/bibtex-x/tests')
-rwxr-xr-xbiblio/bibtex/bibtex-x/tests/bibtex8-char.test48
-rwxr-xr-xbiblio/bibtex/bibtex-x/tests/bibtex8-sort.test36
-rwxr-xr-xbiblio/bibtex/bibtex-x/tests/bibtex8.test17
-rwxr-xr-xbiblio/bibtex/bibtex-x/tests/bibtex8u-mem.test77
-rwxr-xr-xbiblio/bibtex/bibtex-x/tests/bibtexu-basic.test25
-rwxr-xr-xbiblio/bibtex/bibtex-x/tests/bibtexu-char.test54
-rwxr-xr-xbiblio/bibtex/bibtex-x/tests/bibtexu-range.test22
-rwxr-xr-xbiblio/bibtex/bibtex-x/tests/bibtexu-sort.test36
-rwxr-xr-xbiblio/bibtex/bibtex-x/tests/bibtexu-yannis.test23
-rwxr-xr-xbiblio/bibtex/bibtex-x/tests/bibtexu.test17
-rw-r--r--biblio/bibtex/bibtex-x/tests/casea.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/casea.bbl12
-rw-r--r--biblio/bibtex/bibtex-x/tests/caseu.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/caseu.bbl52
-rw-r--r--biblio/bibtex/bibtex-x/tests/chara.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/chara.bbl20
-rw-r--r--biblio/bibtex/bibtex-x/tests/charu.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/charu.bbl53
-rw-r--r--biblio/bibtex/bibtex-x/tests/exampl.bbl212
-rw-r--r--biblio/bibtex/bibtex-x/tests/iscjku.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/iscjku.bbl63
-rw-r--r--biblio/bibtex/bibtex-x/tests/ltnbib.bib67
-rw-r--r--biblio/bibtex/bibtex-x/tests/mlgbib.bib159
-rw-r--r--biblio/bibtex/bibtex-x/tests/namea.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/namea.bbl32
-rw-r--r--biblio/bibtex/bibtex-x/tests/nameu.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/nameu.bbl85
-rw-r--r--biblio/bibtex/bibtex-x/tests/perioda.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/perioda.bbl18
-rw-r--r--biblio/bibtex/bibtex-x/tests/periodu.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/periodu.bbl64
-rw-r--r--biblio/bibtex/bibtex-x/tests/sort.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/sort1.bbl15
-rw-r--r--biblio/bibtex/bibtex-x/tests/sort1.csf275
-rw-r--r--biblio/bibtex/bibtex-x/tests/sort2.bbl15
-rw-r--r--biblio/bibtex/bibtex-x/tests/sort2.csf114
-rw-r--r--biblio/bibtex/bibtex-x/tests/sort3.bbl15
-rw-r--r--biblio/bibtex/bibtex-x/tests/sort3.csf281
-rw-r--r--biblio/bibtex/bibtex-x/tests/sortu-az.bbl27
-rw-r--r--biblio/bibtex/bibtex-x/tests/sortu-da.bbl27
-rw-r--r--biblio/bibtex/bibtex-x/tests/sortu-en.bbl27
-rw-r--r--biblio/bibtex/bibtex-x/tests/sortu-fi.bbl27
-rw-r--r--biblio/bibtex/bibtex-x/tests/sortu-tr.bbl27
-rw-r--r--biblio/bibtex/bibtex-x/tests/sortu.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/substra.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/substra.bbl334
-rw-r--r--biblio/bibtex/bibtex-x/tests/substru.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/substru.bbl885
-rw-r--r--biblio/bibtex/bibtex-x/tests/testcase.bst44
-rw-r--r--biblio/bibtex/bibtex-x/tests/testcasea.bib8
-rw-r--r--biblio/bibtex/bibtex-x/tests/testcaseu.bib48
-rw-r--r--biblio/bibtex/bibtex-x/tests/testchar.bst40
-rw-r--r--biblio/bibtex/bibtex-x/tests/testchara.bib18
-rw-r--r--biblio/bibtex/bibtex-x/tests/testcharu.bib56
-rw-r--r--biblio/bibtex/bibtex-x/tests/testdata.bib43
-rw-r--r--biblio/bibtex/bibtex-x/tests/testiscjk.bst47
-rw-r--r--biblio/bibtex/bibtex-x/tests/testiscjku.bib66
-rw-r--r--biblio/bibtex/bibtex-x/tests/testname.bst64
-rw-r--r--biblio/bibtex/bibtex-x/tests/testperiod.bst40
-rw-r--r--biblio/bibtex/bibtex-x/tests/testperioda.bib8
-rw-r--r--biblio/bibtex/bibtex-x/tests/testperiodu.bib33
-rw-r--r--biblio/bibtex/bibtex-x/tests/testsortu.bib27
-rw-r--r--biblio/bibtex/bibtex-x/tests/teststyle.bst36
-rw-r--r--biblio/bibtex/bibtex-x/tests/testsubstr.bst91
-rw-r--r--biblio/bibtex/bibtex-x/tests/testsubstra.bib21
-rw-r--r--biblio/bibtex/bibtex-x/tests/testsubstru.bib59
-rw-r--r--biblio/bibtex/bibtex-x/tests/testtxtprfx.bst45
-rw-r--r--biblio/bibtex/bibtex-x/tests/testwidth.bst38
-rw-r--r--biblio/bibtex/bibtex-x/tests/testwidtha.bib155
-rw-r--r--biblio/bibtex/bibtex-x/tests/testwidthu.bib378
-rw-r--r--biblio/bibtex/bibtex-x/tests/txtprfxa.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/txtprfxa.bbl58
-rw-r--r--biblio/bibtex/bibtex-x/tests/txtprfxu.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/txtprfxu.bbl149
-rw-r--r--biblio/bibtex/bibtex-x/tests/ubasic.aux6
-rw-r--r--biblio/bibtex/bibtex-x/tests/ubasic.bbl8
-rw-r--r--biblio/bibtex/bibtex-x/tests/ubasic.bib13
-rw-r--r--biblio/bibtex/bibtex-x/tests/ubasic.tex15
-rw-r--r--biblio/bibtex/bibtex-x/tests/urange.aux6
-rw-r--r--biblio/bibtex/bibtex-x/tests/urange.bbl8
-rw-r--r--biblio/bibtex/bibtex-x/tests/urange.bib13
-rw-r--r--biblio/bibtex/bibtex-x/tests/urange.tex15
-rw-r--r--biblio/bibtex/bibtex-x/tests/widtha.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/widtha.bbl158
-rw-r--r--biblio/bibtex/bibtex-x/tests/widthu.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/widthu.bbl417
-rw-r--r--biblio/bibtex/bibtex-x/tests/yannis.aux4
-rw-r--r--biblio/bibtex/bibtex-x/tests/yannis.bbl49
-rw-r--r--biblio/bibtex/bibtex-x/tests/yannis.bib56
89 files changed, 5669 insertions, 0 deletions
diff --git a/biblio/bibtex/bibtex-x/tests/bibtex8-char.test b/biblio/bibtex/bibtex-x/tests/bibtex8-char.test
new file mode 100755
index 0000000000..06d5e41af3
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/bibtex8-char.test
@@ -0,0 +1,48 @@
+#! /bin/sh -vx
+#
+# Copyright 2022 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+# You may freely use, modify and/or distribute this file.
+
+test -d tests || mkdir -p tests
+
+rc=0
+
+TEXMFCNF=$srcdir/../kpathsea
+BSTINPUTS=$srcdir/tests:$srcdir/csf
+BIBINPUTS=$srcdir/tests
+export TEXMFCNF BSTINPUTS BIBINPUTS
+
+
+## test for add.period$
+cp $srcdir/tests/perioda.aux tests/xperioda.aux
+./bibtex8 tests/xperioda || rc=3
+diff $srcdir/tests/perioda.bbl tests/xperioda.bbl || rc=4
+
+## test for substring$
+cp $srcdir/tests/substra.aux tests/xsubstra.aux
+./bibtex8 tests/xsubstra || rc=5
+diff $srcdir/tests/substra.bbl tests/xsubstra.bbl || rc=6
+
+## test for text.length$, text.prefix$
+cp $srcdir/tests/txtprfxa.aux tests/xtxtprfxa.aux
+./bibtex8 tests/xtxtprfxa || rc=7
+diff $srcdir/tests/txtprfxa.bbl tests/xtxtprfxa.bbl || rc=8
+
+## test for width$
+cp $srcdir/tests/widtha.aux tests/xwidtha.aux
+./bibtex8 --csfile sort1.csf tests/xwidtha || rc=9
+diff $srcdir/tests/widtha.bbl tests/xwidtha.bbl || rc=10
+
+## test for chr.to.int$, int.to.str$, int.to.chr$
+cp $srcdir/tests/chara.aux tests/xchara.aux
+./bibtex8 tests/xchara || rc=11
+diff $srcdir/tests/chara.bbl tests/xchara.bbl || rc=12
+
+## test for num.names$, format.name$
+cp $srcdir/tests/namea.aux tests/xnamea.aux
+max_print_line=119 ./bibtex8 tests/xnamea || rc=13
+diff $srcdir/tests/namea.bbl tests/xnamea.bbl || rc=14
+
+
+exit $rc
+
diff --git a/biblio/bibtex/bibtex-x/tests/bibtex8-sort.test b/biblio/bibtex/bibtex-x/tests/bibtex8-sort.test
new file mode 100755
index 0000000000..9599b0a18f
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/bibtex8-sort.test
@@ -0,0 +1,36 @@
+#! /bin/sh -vx
+# $Id$
+# Copyright 2017 Karl Berry <tex-live@tug.org>
+# Copyright 2010 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+# Using test data from Philipp Lehman <lehman@gmx.net>
+
+test -d tests || mkdir -p tests
+
+rc=0
+
+TEXMFCNF=$srcdir/../kpathsea
+BSTINPUTS=$srcdir/tests
+BIBINPUTS=$srcdir/tests
+export TEXMFCNF BSTINPUTS BIBINPUTS
+
+rm -f tests/xsort[123].bbl tests/xcase[123].bbl
+
+for i in 1 2 3; do
+
+## test for sorting and change.case$
+cp $srcdir/tests/sort.aux tests/xsort$i.aux
+./bibtex8 --csfile sort$i.csf tests/xsort$i || rc=1
+diff $srcdir/tests/sort$i.bbl tests/xsort$i.bbl || rc=2
+
+## test for change.case$
+cp $srcdir/tests/casea.aux tests/xcase$i.aux
+./bibtex8 --csfile sort$i.csf tests/xcase$i || rc=3
+diff $srcdir/tests/casea.bbl tests/xcase$i.bbl || rc=4
+
+done
+
+
+exit $rc
+
diff --git a/biblio/bibtex/bibtex-x/tests/bibtex8.test b/biblio/bibtex/bibtex-x/tests/bibtex8.test
new file mode 100755
index 0000000000..e263e77cd6
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/bibtex8.test
@@ -0,0 +1,17 @@
+#! /bin/sh -vx
+# $Id: bibtex8.test 63257 2022-05-08 13:25:05Z takuji $
+# Copyright 2017 Karl Berry <tex-live@tug.org>
+# Copyright 2010 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+test -d tests || mkdir -p tests
+rm -f tests/xexampl.*
+
+cp $srcdir/../web2c/tests/exampl.aux tests/xexampl.aux
+
+TEXMFCNF=$srcdir/../kpathsea \
+ BSTINPUTS=$srcdir/../web2c/tests \
+ BIBINPUTS=$srcdir/../web2c/tests \
+ ./bibtex8 -7 tests/xexampl || test $? = 1 || exit 1
+diff $srcdir/tests/exampl.bbl tests/xexampl.bbl || exit 2
+
diff --git a/biblio/bibtex/bibtex-x/tests/bibtex8u-mem.test b/biblio/bibtex/bibtex-x/tests/bibtex8u-mem.test
new file mode 100755
index 0000000000..1993251531
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/bibtex8u-mem.test
@@ -0,0 +1,77 @@
+#! /bin/sh -vx
+# $Id$
+# Copyright 2017 Karl Berry <tex-live@tug.org>
+# Copyright 2010 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+# Using test data from Philipp Lehman <lehman@gmx.net>
+
+test -d tests || mkdir -p tests
+
+# Create bib data
+mk_bib () {
+ for i
+ do
+ for j in 0 1 2 3 4 5 6 7 8 9; do
+ for k in 0 1 2 3 4 5 6 7 8 9; do
+ for l in 0 1 2 3 4 5 6 7 8 9; do
+ cat <<EOF
+@Type{key$i$j$k$l,
+ field001 = {Value 001},
+ field002 = {Value 002},
+ field003 = {Value 003},
+ field004 = {Value 004},
+ field005 = {Value 005},
+ field006 = {Value 006},
+ field007 = {Value 007},
+ field008 = {Value 008},
+ field009 = {Value 009},
+ field010 = {Value 010}
+}
+
+EOF
+ done
+ done
+ done
+ done
+}
+
+# Create aux data
+mk_aux () {
+ cat <<EOF
+\relax
+\citation{*}
+\bibstyle{$1}
+\bibdata{memtest}
+EOF
+}
+
+for t in 1 2 3; do
+
+ mk_aux memdata$t >tests/memtest$t.aux
+
+ env=
+
+ case $t in
+ 1) mk_bib 0 >tests/memtest.bib;;
+ 2) mk_bib 1 >>tests/memtest.bib;;
+ 3) env='ent_str_size=2000 glob_str_size=2000';;
+ esac
+
+ echo "Running memtest$t ..."
+
+ eval $env \
+ TEXMFCNF=$srcdir/../kpathsea \
+ BSTINPUTS=$srcdir/../web2c/tests:$srcdir/csf \
+ BIBINPUTS=./tests \
+ ./bibtex8 tests/memtest$t || exit 1
+
+ cp -p tests/memtest$t.aux tests/memtestu$t.aux
+ eval $env \
+ TEXMFCNF=$srcdir/../kpathsea \
+ BSTINPUTS=$srcdir/../web2c/tests:$srcdir/csf \
+ BIBINPUTS=./tests \
+ ./bibtexu tests/memtestu$t || exit 2
+
+done
+
diff --git a/biblio/bibtex/bibtex-x/tests/bibtexu-basic.test b/biblio/bibtex/bibtex-x/tests/bibtexu-basic.test
new file mode 100755
index 0000000000..0db8e5f295
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/bibtexu-basic.test
@@ -0,0 +1,25 @@
+#! /bin/sh -vx
+# $Id: bibtexu-yannis.test 51452 2019-06-25 01:28:47Z karl $
+# Public domain. Originally written by Karl Berry, 2021.
+
+test -d tests || mkdir -p tests
+
+testname=ubasic
+# due to lack of libpthread:
+# terminate called after throwing an instance of 'std::system_error'
+# what(): Unknown error -1
+# Aborted
+
+cp $srcdir/tests/$testname.aux tests/x$testname.aux || exit 1
+
+TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
+BSTINPUTS=$srcdir/../tests/texmf; export BSTINPUTS
+BIBINPUTS=$srcdir/tests; export BIBINPUTS
+
+if ./bibtexu -t -d all tests/x$testname; then :; else
+ echo "*** bibtexu failed, tests/x$testname.blg is:" >&2
+ cat tests/x$testname.blg >&2
+ exit 1
+fi
+
+diff $srcdir/tests/$testname.bbl tests/x$testname.bbl || exit 1
diff --git a/biblio/bibtex/bibtex-x/tests/bibtexu-char.test b/biblio/bibtex/bibtex-x/tests/bibtexu-char.test
new file mode 100755
index 0000000000..727810c682
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/bibtexu-char.test
@@ -0,0 +1,54 @@
+#! /bin/sh -vx
+#
+# Copyright 2022 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+# You may freely use, modify and/or distribute this file.
+
+test -d tests || mkdir -p tests
+
+rc=0
+
+TEXMFCNF=$srcdir/../kpathsea
+BSTINPUTS=$srcdir/tests
+BIBINPUTS=$srcdir/tests
+export TEXMFCNF BSTINPUTS BIBINPUTS
+
+
+## test for add.period$
+cp $srcdir/tests/periodu.aux tests/xperiodu.aux
+./bibtexu tests/xperiodu || rc=3
+diff $srcdir/tests/periodu.bbl tests/xperiodu.bbl || rc=4
+
+## test for substring$
+cp $srcdir/tests/substru.aux tests/xsubstru.aux
+./bibtexu tests/xsubstru || rc=5
+diff $srcdir/tests/substru.bbl tests/xsubstru.bbl || rc=6
+
+## test for text.length$, text.prefix$
+cp $srcdir/tests/txtprfxu.aux tests/xtxtprfxu.aux
+./bibtexu tests/xtxtprfxu || rc=7
+diff $srcdir/tests/txtprfxu.bbl tests/xtxtprfxu.bbl || rc=8
+
+## test for width$
+## (FIXME) Greek, Cyrillic are not impremented yet
+cp $srcdir/tests/widthu.aux tests/xwidthu.aux
+./bibtexu tests/xwidthu || rc=9
+diff $srcdir/tests/widthu.bbl tests/xwidthu.bbl || rc=10
+
+## test for chr.to.int$, int.to.str$, int.to.chr$
+cp $srcdir/tests/charu.aux tests/xcharu.aux
+./bibtexu tests/xcharu || rc=11
+diff $srcdir/tests/charu.bbl tests/xcharu.bbl || rc=12
+
+## test for num.names$, format.name$
+cp $srcdir/tests/nameu.aux tests/xnameu.aux
+max_print_line=119 ./bibtexu tests/xnameu || rc=13
+diff $srcdir/tests/nameu.bbl tests/xnameu.bbl || rc=14
+
+## test for is.knj.str$
+cp $srcdir/tests/iscjku.aux tests/xiscjku.aux
+./bibtexu tests/xiscjku || rc=15
+diff $srcdir/tests/iscjku.bbl tests/xiscjku.bbl || rc=16
+
+
+exit $rc
+
diff --git a/biblio/bibtex/bibtex-x/tests/bibtexu-range.test b/biblio/bibtex/bibtex-x/tests/bibtexu-range.test
new file mode 100755
index 0000000000..de6f2e0fc8
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/bibtexu-range.test
@@ -0,0 +1,22 @@
+#! /bin/sh -vx
+# $Id: bibtexu-range.test 59662 2021-06-20 22:56:11Z karl $
+# Public domain. Originally written by Karl Berry, 2021.
+
+test -d tests || mkdir -p tests
+
+testname=urange
+# Segmentation fault
+
+cp $srcdir/tests/$testname.aux tests/x$testname.aux
+
+TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
+BSTINPUTS=$srcdir/../tests/texmf; export BSTINPUTS
+BIBINPUTS=$srcdir/tests; export BIBINPUTS
+
+if ./bibtexu -t -d all tests/x$testname; then :; else
+ echo "*** bibtexu failed, tests/x$testname.blg is:" >&2
+ cat tests/x$testname.blg >&2
+ exit 1
+fi
+
+diff $srcdir/tests/$testname.bbl tests/x$testname.bbl || exit 1
diff --git a/biblio/bibtex/bibtex-x/tests/bibtexu-sort.test b/biblio/bibtex/bibtex-x/tests/bibtexu-sort.test
new file mode 100755
index 0000000000..624d7fb48a
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/bibtexu-sort.test
@@ -0,0 +1,36 @@
+#! /bin/sh -vx
+#
+# Copyright 2022 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+# You may freely use, modify and/or distribute this file.
+
+test -d tests || mkdir -p tests
+
+rc=0
+
+TEXMFCNF=$srcdir/../kpathsea
+BSTINPUTS=$srcdir/tests
+BIBINPUTS=$srcdir/tests
+export TEXMFCNF BSTINPUTS BIBINPUTS
+
+rm -f tests/xsortu-*.bbl tests/xcaseu.bbl
+
+for loc in en az da fi tr; do
+
+## test for sorting and change.case$
+cp $srcdir/tests/sortu.aux tests/xsortu-$loc.aux
+./bibtexu -o $loc tests/xsortu-$loc || rc=1
+diff $srcdir/tests/sortu-$loc.bbl tests/xsortu-$loc.bbl || rc=2
+
+done
+
+
+## test for change.case$
+cp $srcdir/tests/caseu.aux tests/xcaseu.aux
+max_print_line=99 ./bibtexu tests/xcaseu || rc=3
+diff $srcdir/tests/caseu.bbl tests/xcaseu.bbl || rc=4
+
+
+exit $rc
+
+
+
diff --git a/biblio/bibtex/bibtex-x/tests/bibtexu-yannis.test b/biblio/bibtex/bibtex-x/tests/bibtexu-yannis.test
new file mode 100755
index 0000000000..7e2fd43e4e
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/bibtexu-yannis.test
@@ -0,0 +1,23 @@
+#! /bin/sh -vx
+# $Id: bibtexu-yannis.test 60293 2021-08-21 13:42:52Z takuji $
+# Copyright 2019-2021 Karl Berry <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+# Some actual sorting needed.
+
+test -d tests || mkdir -p tests
+
+testname=yannis
+
+cp $srcdir/tests/$testname.aux tests/x$testname.aux || exit 1
+
+TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
+BSTINPUTS=$srcdir/../web2c/tests; export BSTINPUTS
+BIBINPUTS=$srcdir/tests; export BIBINPUTS
+
+if ./bibtexu -t -d all -l fr -o fr tests/x$testname; then :; else
+ echo "*** bibtexu failed, tests/x$testname.blg is:" >&2
+ cat tests/x$testname.blg >&2
+ exit 1
+fi
+
+diff $srcdir/tests/$testname.bbl tests/x$testname.bbl || exit 1
diff --git a/biblio/bibtex/bibtex-x/tests/bibtexu.test b/biblio/bibtex/bibtex-x/tests/bibtexu.test
new file mode 100755
index 0000000000..d69dc5f656
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/bibtexu.test
@@ -0,0 +1,17 @@
+#! /bin/sh -vx
+# $Id: bibtexu.test 63257 2022-05-08 13:25:05Z takuji $
+# Copyright 2017 Karl Berry <tex-live@tug.org>
+# Copyright 2010 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+test -d tests || mkdir -p tests
+rm -f tests/xexampl.*
+
+cp $srcdir/../web2c/tests/exampl.aux tests/xexampl.aux
+
+TEXMFCNF=$srcdir/../kpathsea \
+ BSTINPUTS=$srcdir/../web2c/tests \
+ BIBINPUTS=$srcdir/../web2c/tests \
+ ./bibtexu tests/xexampl || test $? = 1 || exit 1
+diff $srcdir/tests/exampl.bbl tests/xexampl.bbl || exit 2
+
diff --git a/biblio/bibtex/bibtex-x/tests/casea.aux b/biblio/bibtex/bibtex-x/tests/casea.aux
new file mode 100644
index 0000000000..6c0ae9369a
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/casea.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testcase}
+\bibdata{testcasea}
diff --git a/biblio/bibtex/bibtex-x/tests/casea.bbl b/biblio/bibtex/bibtex-x/tests/casea.bbl
new file mode 100644
index 0000000000..8283ec0097
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/casea.bbl
@@ -0,0 +1,12 @@
+\section*{Test result}
+\begin{itemize}
+\item[~] ABC HIJ XYZ abc hij xyz {ACE} {ace}
+\item[u] ABC HIJ XYZ ABC HIJ XYZ {ACE} {ace}
+\item[l] abc hij xyz abc hij xyz {ACE} {ace}
+\item[t] Abc hij xyz abc hij xyz {ACE} {ace}
+\item[~] {} {}
+\item[u] {} {}
+\item[l] {} {}
+\item[t] {} {}
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/caseu.aux b/biblio/bibtex/bibtex-x/tests/caseu.aux
new file mode 100644
index 0000000000..bd03d76dbb
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/caseu.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testcase}
+\bibdata{testcaseu}
diff --git a/biblio/bibtex/bibtex-x/tests/caseu.bbl b/biblio/bibtex/bibtex-x/tests/caseu.bbl
new file mode 100644
index 0000000000..2391fbf5af
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/caseu.bbl
@@ -0,0 +1,52 @@
+\section*{Test result}
+\begin{itemize}
+\item[~] ÀÁÂ ÆÇÈ ÔÕÖ ØÙÚ ÜÝÞ àáâ æçè ôõö øùú üýþ {ÆÇÈ} {æçè}
+\item[u] ÀÁÂ ÆÇÈ ÔÕÖ ØÙÚ ÜÝÞ ÀÁÂ ÆÇÈ ÔÕÖ ØÙÚ ÜÝÞ {ÆÇÈ} {æçè}
+\item[l] àáâ æçè ôõö øùú üýþ àáâ æçè ôõö øùú üýþ {ÆÇÈ} {æçè}
+\item[t] Àáâ æçè ôõö øùú üýþ àáâ æçè ôõö øùú üýþ {ÆÇÈ} {æçè}
+\item[~] ĀĂĄ IJĴĶ ĹĻĽ ŃŅŇ āăą ijĵķ ĺļľ ńņň
+\item[u] ĀĂĄ IJĴĶ ĹĻĽ ŃŅŇ ĀĂĄ IJĴĶ ĹĻĽ ŃŅŇ
+\item[l] āăą ijĵķ ĺļľ ńņň āăą ijĵķ ĺļľ ńņň
+\item[t] Āăą ijĵķ ĺļľ ńņň āăą ijĵķ ĺļľ ńņň
+\item[~] ABC HIJ XYZ abc hij xyz {ACE} {ace}
+\item[u] ABC HIJ XYZ ABC HIJ XYZ {ACE} {ace}
+\item[l] abc hij xyz abc hij xyz {ACE} {ace}
+\item[t] Abc hij xyz abc hij xyz {ACE} {ace}
+\item[~] SS S ß s
+\item[u] SS S SS S
+\item[l] ss s ß s
+\item[t] Ss s ß s
+\item[~] ŊŌŎ ŲŴŶ Ÿ ŹŻŽ ŋōŏ ųŵŷ ÿ źżž
+\item[u] ŊŌŎ ŲŴŶ Ÿ ŹŻŽ ŊŌŎ ŲŴŶ Ÿ ŹŻŽ
+\item[l] ŋōŏ ųŵŷ ÿ źżž ŋōŏ ųŵŷ ÿ źżž
+\item[t] Ŋōŏ ųŵŷ ÿ źżž ŋōŏ ųŵŷ ÿ źżž
+\item[~] ΑΒΓ ΠΡ ΣΤ ΧΨΩΪ αβγ πρ στ χψωϊ {ΑΠΣ} {απσ}
+\item[u] ΑΒΓ ΠΡ ΣΤ ΧΨΩΪ ΑΒΓ ΠΡ ΣΤ ΧΨΩΪ {ΑΠΣ} {απσ}
+\item[l] αβγ πρ στ χψωϊ αβγ πρ στ χψωϊ {ΑΠΣ} {απσ}
+\item[t] Αβγ πρ στ χψωϊ αβγ πρ στ χψωϊ {ΑΠΣ} {απσ}
+\item[~] ͰͲͶ ϘϚϜ ϪϬϮ Ϸ Ϻ ͱͳͷ ϙϛϝ ϫϭϯ ϸ ϻ
+\item[u] ͰͲͶ ϘϚϜ ϪϬϮ Ϸ Ϻ ͰͲͶ ϘϚϜ ϪϬϮ Ϸ Ϻ
+\item[l] ͱͳͷ ϙϛϝ ϫϭϯ ϸ ϻ ͱͳͷ ϙϛϝ ϫϭϯ ϸ ϻ
+\item[t] Ͱͳͷ ϙϛϝ ϫϭϯ ϸ ϻ ͱͳͷ ϙϛϝ ϫϭϯ ϸ ϻ
+\item[~] ӐӒӔ ӺӼӾ ԀԂԄ ԪԬԮ ӑӓӕ ӻӽӿ ԁԃԅ ԫԭԯ
+\item[u] ӐӒӔ ӺӼӾ ԀԂԄ ԪԬԮ ӐӒӔ ӺӼӾ ԀԂԄ ԪԬԮ
+\item[l] ӑӓӕ ӻӽӿ ԁԃԅ ԫԭԯ ӑӓӕ ӻӽӿ ԁԃԅ ԫԭԯ
+\item[t] Ӑӓӕ ӻӽӿ ԁԃԅ ԫԭԯ ӑӓӕ ӻӽӿ ԁԃԅ ԫԭԯ
+\item[~] АБВ ОП РС ЭЮЯ абв оп рс эюя {АРЯ} {апя}
+\item[u] АБВ ОП РС ЭЮЯ АБВ ОП РС ЭЮЯ {АРЯ} {апя}
+\item[l] абв оп рс эюя абв оп рс эюя {АРЯ} {апя}
+\item[t] Абв оп рс эюя абв оп рс эюя {АРЯ} {апя}
+\item[~] ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ ѐёђѓєѕіїјљњћќѝўџ
+\item[u] ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ
+\item[l] ѐёђѓєѕіїјљњћќѝўџ ѐёђѓєѕіїјљњћќѝўџ
+\item[t] Ѐёђѓєѕіїјљњћќѝўџ ѐёђѓєѕіїјљњћќѝўџ
+\item[~] ѠѢѤ ѼѾҀ ҊҌҎ ҺҼҾ ѡѣѥ ѽѿҁ ҋҍҏ һҽҿ
+\item[u] ѠѢѤ ѼѾҀ ҊҌҎ ҺҼҾ ѠѢѤ ѼѾҀ ҊҌҎ ҺҼҾ
+\item[l] ѡѣѥ ѽѿҁ ҋҍҏ һҽҿ ѡѣѥ ѽѿҁ ҋҍҏ һҽҿ
+\item[t] Ѡѣѥ ѽѿҁ ҋҍҏ һҽҿ ѡѣѥ ѽѿҁ ҋҍҏ һҽҿ
+\item[~] Ӏ ӁӃӅ ӉӋӍ ӏ ӂӄӆ ӊӌӎ
+\item[u] Ӏ ӁӃӅ ӉӋӍ Ӏ ӁӃӅ ӉӋӍ
+\item[l] ӏ ӂӄӆ ӊӌӎ ӏ ӂӄӆ ӊӌӎ
+\item[t] Ӏ ӂӄӆ ӊӌӎ ӏ ӂӄӆ ӊӌӎ
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/chara.aux b/biblio/bibtex/bibtex-x/tests/chara.aux
new file mode 100644
index 0000000000..218274582d
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/chara.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testchar}
+\bibdata{testchara}
diff --git a/biblio/bibtex/bibtex-x/tests/chara.bbl b/biblio/bibtex/bibtex-x/tests/chara.bbl
new file mode 100644
index 0000000000..292ab63881
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/chara.bbl
@@ -0,0 +1,20 @@
+\section*{Test result}
+\begin{itemize}
+\item A i2str: 65 i2chr: A
+\item i2str: 197 i2chr:
+\item C i2str: 67 i2chr: C
+\item i2str: 199 i2chr:
+\item D i2str: 68 i2chr: D
+\item E i2str: 69 i2chr: E
+\item i2str: 200 i2chr:
+\item i i2str: 105 i2chr: i
+\item i2str: 238 i2chr:
+\item o i2str: 111 i2chr: o
+\item u i2str: 117 i2chr: u
+\item i2str: 252 i2chr:
+\item y i2str: 121 i2chr: y
+\item i2str: 208 i2chr:
+\item i2str: 248 i2chr:
+\item i2str: 253 i2chr:
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/charu.aux b/biblio/bibtex/bibtex-x/tests/charu.aux
new file mode 100644
index 0000000000..76f1a5c09e
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/charu.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testchar}
+\bibdata{testcharu}
diff --git a/biblio/bibtex/bibtex-x/tests/charu.bbl b/biblio/bibtex/bibtex-x/tests/charu.bbl
new file mode 100644
index 0000000000..b268af5eb9
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/charu.bbl
@@ -0,0 +1,53 @@
+\section*{Test result}
+\begin{itemize}
+\item   i2str: 12288 i2chr:  
+\item A i2str: 65 i2chr: A
+\item Å i2str: 197 i2chr: Å
+\item C i2str: 67 i2chr: C
+\item Ç i2str: 199 i2chr: Ç
+\item D i2str: 68 i2chr: D
+\item E i2str: 69 i2chr: E
+\item È i2str: 200 i2chr: È
+\item i i2str: 105 i2chr: i
+\item î i2str: 238 i2chr: î
+\item o i2str: 111 i2chr: o
+\item u i2str: 117 i2chr: u
+\item ü i2str: 252 i2chr: ü
+\item y i2str: 121 i2chr: y
+\item ý i2str: 253 i2chr: ý
+\item Ð i2str: 208 i2chr: Ð
+\item ø i2str: 248 i2chr: ø
+\item Α i2str: 913 i2chr: Α
+\item Β i2str: 914 i2chr: Β
+\item Γ i2str: 915 i2chr: Γ
+\item χ i2str: 967 i2chr: χ
+\item ψ i2str: 968 i2chr: ψ
+\item ω i2str: 969 i2chr: ω
+\item А i2str: 1040 i2chr: А
+\item Б i2str: 1041 i2chr: Б
+\item В i2str: 1042 i2chr: В
+\item э i2str: 1101 i2chr: э
+\item ю i2str: 1102 i2chr: ю
+\item я i2str: 1103 i2chr: я
+\item 가 i2str: 44032 i2chr: 가
+\item 글 i2str: 44544 i2chr: 글
+\item 나 i2str: 45208 i2chr: 나
+\item 다 i2str: 45796 i2chr: 다
+\item 텍 i2str: 53581 i2chr: 텍
+\item 한 i2str: 54620 i2chr: 한
+\item あ i2str: 12354 i2chr: あ
+\item い i2str: 12356 i2chr: い
+\item う i2str: 12358 i2chr: う
+\item ヱ i2str: 12529 i2chr: ヱ
+\item ヲ i2str: 12530 i2chr: ヲ
+\item ン i2str: 12531 i2chr: ン
+\item 一 i2str: 19968 i2chr: 一
+\item 三 i2str: 19977 i2chr: 三
+\item 二 i2str: 20108 i2chr: 二
+\item 𠮟 i2str: 134047 i2chr: 𠮟
+\item 拾 i2str: 25342 i2chr: 拾
+\item 捌 i2str: 25420 i2chr: 捌
+\item 玖 i2str: 29590 i2chr: 玖
+\item 𥝱 i2str: 153457 i2chr: 𥝱
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/exampl.bbl b/biblio/bibtex/bibtex-x/tests/exampl.bbl
new file mode 100644
index 0000000000..442298f763
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/exampl.bbl
@@ -0,0 +1,212 @@
+\newcommand{\noopsort}[1]{} \newcommand{\printfirst}[2]{#1}
+ \newcommand{\singleletter}[1]{#1} \newcommand{\switchargs}[2]{#2#1}
+\begin{thebibliography}{}
+
+\bibitem[Aamport, 1986a]{article-minimal}
+Aamport, L.~A. (1986a).
+\newblock The gnats and gnus document preparation system.
+\newblock {\em \mbox{G-Animal's} Journal}.
+
+\bibitem[Aamport, 1986b]{article-full}
+Aamport, L.~A. (1986b).
+\newblock The gnats and gnus document preparation system.
+\newblock {\em \mbox{G-Animal's} Journal}, 41(7):73+.
+\newblock This is a full ARTICLE entry.
+
+\bibitem[Aamport, 1986c]{article-crossref}
+Aamport, L.~A. (1986c).
+\newblock The gnats and gnus document preparation system.
+\newblock In \cite{whole-journal}, pages 73+.
+\newblock This is a cross-referencing ARTICLE entry.
+
+\bibitem[GAJ, 1986]{whole-journal}
+GAJ (1986).
+\newblock {\em \mbox{G-Animal's} Journal}, 41(7).
+\newblock The entire issue is devoted to gnats and gnus (this entry is a
+ cross-referenced ARTICLE (journal)).
+
+\bibitem[Knuth, 1968]{whole-set}
+Knuth, D.~E. ({\noopsort{1973a}}{\switchargs{--90}{1968}}).
+\newblock {\em The Art of Computer Programming}.
+\newblock Four volumes. Addison-Wesley.
+\newblock Seven volumes planned (this is a cross-referenced set of BOOKs).
+
+\bibitem[Knuth, 1973a]{inbook-minimal}
+Knuth, D.~E. ({\noopsort{1973b}}1973a).
+\newblock {\em Fundamental Algorithms}, chapter 1.2.
+\newblock Addison-Wesley.
+
+\bibitem[Knuth, 1973b]{inbook-full}
+Knuth, D.~E. ({\noopsort{1973b}}1973b).
+\newblock {\em Fundamental Algorithms}, volume~1 of {\em The Art of Computer
+ Programming}, section 1.2, pages 10--119.
+\newblock Addison-Wesley, Reading, Massachusetts, second edition.
+\newblock This is a full INBOOK entry.
+
+\bibitem[Knuth, 1973c]{inbook-crossref}
+Knuth, D.~E. ({\noopsort{1973b}}1973c).
+\newblock {\em Fundamental Algorithms}, section 1.2.
+\newblock Volume~1 of \cite{whole-set}, second edition.
+\newblock This is a cross-referencing INBOOK entry.
+
+\bibitem[Knuth, 1981a]{book-full}
+Knuth, D.~E. ({\noopsort{1973c}}1981a).
+\newblock {\em Seminumerical Algorithms}, volume~2 of {\em The Art of Computer
+ Programming}.
+\newblock Addison-Wesley, Reading, Massachusetts, second edition.
+\newblock This is a full BOOK entry.
+
+\bibitem[Knuth, 1981b]{book-minimal}
+Knuth, D.~E. ({\noopsort{1973c}}1981b).
+\newblock {\em Seminumerical Algorithms}.
+\newblock Addison-Wesley.
+
+\bibitem[Knuth, 1981c]{book-crossref}
+Knuth, D.~E. ({\noopsort{1973c}}1981c).
+\newblock {\em Seminumerical Algorithms}.
+\newblock Volume~2 of \cite{whole-set}, second edition.
+\newblock This is a cross-referencing BOOK entry.
+
+\bibitem[Kn{\printfirst{v}{1987}}, ]{booklet-minimal}
+Kn{\printfirst{v}{1987}}.
+\newblock The programming of computer art.
+
+\bibitem[Knvth, 1988]{booklet-full}
+Knvth, J.~C. (1988).
+\newblock The programming of computer art.
+\newblock Vernier Art Center, Stanford, California.
+\newblock This is a full BOOKLET entry.
+
+\bibitem[Lincoll, 1977a]{incollection-minimal}
+Lincoll, D.~D. (1977a).
+\newblock Semigroups of recurrences.
+\newblock In {\em High Speed Computer and Algorithm Organization}. Academic
+ Press.
+
+\bibitem[Lincoll, 1977b]{incollection-full}
+Lincoll, D.~D. (1977b).
+\newblock Semigroups of recurrences.
+\newblock In Lipcoll, D.~J., Lawrie, D.~H., and Sameh, A.~H., editors, {\em
+ High Speed Computer and Algorithm Organization}, number~23 in Fast Computers,
+ part~3, pages 179--183. Academic Press, New York, third edition.
+\newblock This is a full INCOLLECTION entry.
+
+\bibitem[Lincoll, 1977c]{incollection-crossref}
+Lincoll, D.~D. (1977c).
+\newblock Semigroups of recurrences.
+\newblock In \cite{whole-collection}, pages 179--183.
+\newblock This is a cross-referencing INCOLLECTION entry.
+
+\bibitem[Lipcoll et~al., 1977]{whole-collection}
+Lipcoll, D.~J., Lawrie, D.~H., and Sameh, A.~H., editors (1977).
+\newblock {\em High Speed Computer and Algorithm Organization}.
+\newblock Number~23 in Fast Computers. Academic Press, New York, third edition.
+\newblock This is a cross-referenced BOOK (collection) entry.
+
+\bibitem[Manmaker, ]{manual-minimal}
+Manmaker.
+\newblock {\em The Definitive Computer Manual}.
+
+\bibitem[Manmaker, 1986]{manual-full}
+Manmaker, L. (1986).
+\newblock {\em The Definitive Computer Manual}.
+\newblock Chips-R-Us, Silicon Valley, silver edition.
+\newblock This is a full MANUAL entry.
+
+\bibitem[Masterly, 1988a]{mastersthesis-minimal}
+Masterly, {\'{E}}. (1988a).
+\newblock Mastering thesis writing.
+\newblock Master's thesis, Stanford University.
+
+\bibitem[Masterly, 1988b]{mastersthesis-full}
+Masterly, {\'{E}}. (1988b).
+\newblock Mastering thesis writing.
+\newblock Master's project, Stanford University, English Department.
+\newblock This is a full MASTERSTHESIS entry.
+
+\bibitem[Missilany, ]{misc-minimal}
+Missilany.
+\newblock This is a minimal MISC entry.
+
+\bibitem[Missilany, 1984]{misc-full}
+Missilany, J.-B. (1984).
+\newblock Handing out random pamphlets in airports.
+\newblock Handed out at O'Hare.
+\newblock This is a full MISC entry.
+
+\bibitem[Oaho et~al., 1983a]{inproceedings-minimal}
+Oaho, A.~V., Ullman, J.~D., and Yannakakis, M. (1983a).
+\newblock On notions of information transfer in {VLSI} circuits.
+\newblock In {\em Proc. Fifteenth Annual ACM Symposium on the Theory of
+ Computing}.
+
+\bibitem[Oaho et~al., 1983b]{inproceedings-full}
+Oaho, A.~V., Ullman, J.~D., and Yannakakis, M. (1983b).
+\newblock On notions of information transfer in {VLSI} circuits.
+\newblock In Oz, W.~V. and Yannakakis, M., editors, {\em Proc. Fifteenth Annual
+ ACM Symposium on the Theory of Computing}, number~17 in All ACM Conferences,
+ pages 133--139, Boston. The OX Association for Computing Machinery, Academic
+ Press.
+\newblock This is a full INPROCEDINGS entry.
+
+\bibitem[Oaho et~al., 1983c]{inproceedings-crossref}
+Oaho, A.~V., Ullman, J.~D., and Yannakakis, M. (1983c).
+\newblock On notions of information transfer in {VLSI} circuits.
+\newblock In \cite{whole-proceedings}, pages 133--139.
+\newblock This is a cross-referencing INPROCEEDINGS entry.
+
+\bibitem[OX{\singleletter{stoc}}, 1983a]{whole-proceedings}
+OX{\singleletter{stoc}} (1983a).
+\newblock {\em Proc. Fifteenth Annual Symposium on the Theory of Computing},
+ Boston. The OX Association for Computing Machinery.
+\newblock This is a cross-referenced PROCEEDINGS.
+
+\bibitem[OX{\singleletter{stoc}}, 1983b]{proceedings-minimal}
+OX{\singleletter{stoc}} (1983b).
+\newblock {\em Proc. Fifteenth Annual Symposium on the Theory of Computing}.
+
+\bibitem[Oz and Yannakakis, 1983]{proceedings-full}
+Oz, W.~V. and Yannakakis, M., editors (1983).
+\newblock {\em Proc. Fifteenth Annual Symposium on the Theory of Computing},
+ number~17 in All ACM Conferences, Boston. The OX Association for Computing
+ Machinery, Academic Press.
+\newblock This is a full PROCEEDINGS entry.
+
+\bibitem[Phony-Baloney, 1988a]{phdthesis-minimal}
+Phony-Baloney, F.~P. (1988a).
+\newblock {\em Fighting Fire with Fire: Festooning {F}rench Phrases}.
+\newblock PhD thesis, Fanstord University.
+
+\bibitem[Phony-Baloney, 1988b]{phdthesis-full}
+Phony-Baloney, F.~P. (1988b).
+\newblock {\em Fighting Fire with Fire: Festooning {F}rench Phrases}.
+\newblock {PhD} dissertation, Fanstord University, Department of French.
+\newblock This is a full PHDTHESIS entry.
+
+\bibitem[Terrific, 1988]{techreport-minimal}
+Terrific, T. (1988).
+\newblock An {$O(n \log n / \! \log\log n)$} sorting algorithm.
+\newblock Technical report, Fanstord University.
+
+\bibitem[T{\'{e}}rrific, 1988]{techreport-full}
+T{\'{e}}rrific, T. (1988).
+\newblock An {$O(n \log n / \! \log\log n)$} sorting algorithm.
+\newblock Wishful Research Result~7, Fanstord University, Computer Science
+ Department, Fanstord, California.
+\newblock This is a full TECHREPORT entry.
+
+\bibitem[{\"{U}}nderwood et~al., ]{unpublished-minimal}
+{\"{U}}nderwood, U., {\~N}et, N., and {\={P}}ot, P.
+\newblock Lower bounds for wishful research results.
+\newblock Talk at Fanstord University (this is a minimal UNPUBLISHED entry).
+
+\bibitem[{\"{U}}nderwood et~al., 1988]{unpublished-full}
+{\"{U}}nderwood, U., {\~N}et, N., and {\={P}}ot, P. (1988).
+\newblock Lower bounds for wishful research results.
+\newblock Talk at Fanstord University (this is a full UNPUBLISHED entry).
+
+\bibitem[Volume-2, ]{random-note-crossref}
+Volume-2.
+\newblock Volume~2 is listed under Knuth \cite{book-full}.
+
+\end{thebibliography}
diff --git a/biblio/bibtex/bibtex-x/tests/iscjku.aux b/biblio/bibtex/bibtex-x/tests/iscjku.aux
new file mode 100644
index 0000000000..fc8b3de7e9
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/iscjku.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testiscjk}
+\bibdata{testiscjku}
diff --git a/biblio/bibtex/bibtex-x/tests/iscjku.bbl b/biblio/bibtex/bibtex-x/tests/iscjku.bbl
new file mode 100644
index 0000000000..9e23ac2be5
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/iscjku.bbl
@@ -0,0 +1,63 @@
+\section*{Test result}
+\begin{itemize}
+\item ︵︶︷︸︹︺︻︼︽︾: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ㈀㈁㈂㈠㈡㈢㈱㋐㋑㋒: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item @: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item \: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item #: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item 𚿰𚿱𚿲𚿳𚿵𚿶𚿷𚿸: 2 2 hz:0 kn:2 hg:0 bp:0 misc:0
+\item ■: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item △: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ◇: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ●: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ☀: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ☁: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ☂: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ☃: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ⿰⿱⿲⿳⿴⿵⿶⿷⿸⿹⿺⿻: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ㇀㇁㇂㇃㇠㇡㇢㇣: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item 〄々〆〇【】〠〽: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ㆑㆒㆓㆔㆙㆚㆛㆜㆝㆞㆟: 2048 2048 hz:0 kn:0 hg:0 bp:0
+ misc:2048
+\item ¢£§©®±µ¶: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item £: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ₩: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item 0: 2048 2048 hz:0 kn:0 hg:0 bp:0 misc:2048
+\item 9: 2048 2048 hz:0 kn:0 hg:0 bp:0 misc:2048
+\item A: 2048 2048 hz:0 kn:0 hg:0 bp:0 misc:2048
+\item ACDE iouy: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ĂĆĎĘ ĭőůŷ: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ÅÇÐÈ îøüý: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item mix 나비蝴蝶: 5 5 hz:1 kn:0 hg:4 bp:0 misc:0
+\item mix てふ나비蝴蝶ㄏㄨˊㄉㄧㄝˊ⾍: 2063 2063 hz:1 kn:2 hg:4
+ bp:8 misc:2048
+\item mix てふ蝴蝶: 3 3 hz:1 kn:2 hg:0 bp:0 misc:0
+\item mix 蝴蝶ㄏㄨˊㄉㄧㄝˊ⾍: 2057 2057 hz:1 kn:0 hg:0 bp:8 misc:2048
+\item z: 2048 2048 hz:0 kn:0 hg:0 bp:0 misc:2048
+\item ΑΒΓΔφχψω: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item АБВГьэюя: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ᄀᄁᄂᄃᇶᇷᇸᇹ: 4 4 hz:0 kn:0 hg:4 bp:0 misc:0
+\item ㄱㄲㄳㄴㆉㆊㆋㆌ: 4 4 hz:0 kn:0 hg:4 bp:0 misc:0
+\item 가나다라마한글텍: 4 4 hz:0 kn:0 hg:4 bp:0 misc:0
+\item ꥠꥡꥢꥣꥤꥥꥦꥧ: 4 4 hz:0 kn:0 hg:4 bp:0 misc:0
+\item ힰힱힲힳힴힵힶힷ: 4 4 hz:0 kn:0 hg:4 bp:0 misc:0
+\item あいうえゐゑをん: 2 2 hz:0 kn:2 hg:0 bp:0 misc:0
+\item アイウエヰヱヲン: 2 2 hz:0 kn:2 hg:0 bp:0 misc:0
+\item アイウワヲン: 2 2 hz:0 kn:2 hg:0 bp:0 misc:0
+\item ㌀㌁㌂㌃㌄㌅㌆㌇: 0 0 hz:0 kn:0 hg:0 bp:0 misc:0
+\item ㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ: 2 2 hz:0 kn:2 hg:0 bp:0
+ misc:0
+\item 𛅐𛅑𛅒𛅤𛅥𛅦𛅧: 2 2 hz:0 kn:2 hg:0 bp:0 misc:0
+\item 𛄀𛄁𛄂𛄃𛄄𛄅𛄆𛄇: 2 2 hz:0 kn:2 hg:0 bp:0 misc:0
+\item ㄅㄆㄇㄈㄦㄧㄨㄩ: 8 8 hz:0 kn:0 hg:0 bp:8 misc:0
+\item ㆠㆡㆢㆣㆤㆥㆦㆧ: 8 8 hz:0 kn:0 hg:0 bp:8 misc:0
+\item 一二三四漆捌玖拾: 1 1 hz:1 kn:0 hg:0 bp:0 misc:0
+\item 𪜀𪜁𪜂𪜃𪜄𪜅𪜆𪜇: 1 1 hz:1 kn:0 hg:0 bp:0 misc:0
+\item 㐂㒵㓛㞍㟢㐆㐬㐮㔫㚑㐧: 1 1 hz:1 kn:0 hg:0 bp:0 misc:0
+\item ⺐⺒⺓⺔⺖⺗⺘⺙⻭⻯⻲: 2048 2048 hz:0 kn:0 hg:0 bp:0
+ misc:2048
+\item 櫛杓𦥑𠮟𠀋𡈽𥝱𡚴: 1 1 hz:1 kn:0 hg:0 bp:0 misc:0
+\item 豈更車賈滑串句龜: 1 1 hz:1 kn:0 hg:0 bp:0 misc:0
+\item ⿎⿏⿐⿑⿒⿓⿔⿕: 2048 2048 hz:0 kn:0 hg:0 bp:0 misc:2048
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/ltnbib.bib b/biblio/bibtex/bibtex-x/tests/ltnbib.bib
new file mode 100644
index 0000000000..a31f62838f
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/ltnbib.bib
@@ -0,0 +1,67 @@
+% Bibliography test file
+% Public domain.
+% You may freely use, modify and/or distribute this file.
+
+@string{PH = "Prentice Hall"}
+@string{G = {ditions Gallimard}}
+
+%% ASCII only
+%% author: Given_name Middle_name Family_name
+@book{kernighan78,
+ author = "Brian Wilson Kernighan and Dennis MacAlistair Ritchie",
+ title = "The C Programming Language, 1st edition",
+ publisher = "Prentice Hall",
+ year = 1978,
+}
+
+%% author: Family_name, Given_name Middle_name
+@book{kernighan88,
+ author = "Kernighan, Brian W. AND Ritchie, Dennis M.",
+ title = "The C Programming Language, 2nd edition",
+ publisher = PH,
+ year = 1988,
+}
+
+%% name with Jr
+@book{king63,
+ author = "King, Jr., Martin Luther",
+ title = "I Have a Dream!",
+ year = 1963,
+}
+
+%% Latin-1, name with nobiliary particle "von"
+@book{weber1821,
+ author = "Carl Maria von Weber",
+ title = "Der Freischtz",
+ year = 1821,
+}
+
+%% Latin-1, name with nobiliary particle "de"
+@book{Lautramont,
+ author = "Conte de Lautramont",
+ title = "Les Chants de Maldoror",
+ year = 1868,
+}
+
+%% Latin-1
+@book{Proust,
+ author = "Marcel Proust",
+ title = " la recherche du temps perdu",
+ publisher = "ditions Gallimard",
+ year = "1913--1927",
+}
+
+@book{BrderGrimm,
+ author = "Brder Grimm",
+ title = "Kinder- und Hausmrchen",
+ publisher = "Reimer",
+ year = 1812,
+}
+
+@book{Camus,
+ author = "Albert Camus",
+ title = "L'tranger",
+ publisher = G,
+ year = 1942,
+}
+
diff --git a/biblio/bibtex/bibtex-x/tests/mlgbib.bib b/biblio/bibtex/bibtex-x/tests/mlgbib.bib
new file mode 100644
index 0000000000..c8d415850c
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/mlgbib.bib
@@ -0,0 +1,159 @@
+% Bibliography test file
+% Public domain.
+% You may freely use, modify and/or distribute this file.
+
+@string{PH = "Prentice Hall"}
+@string{ÉG = {Éditions Gallimard}}
+@string{技評 = {技術評論社}}
+
+%% ASCII only
+%% author: Given_name Middle_name Family_name
+@book{kernighan78,
+ author = "Brian Wilson Kernighan and Dennis MacAlistair Ritchie",
+ title = "The C Programming Language, 1st edition",
+ publisher = "Prentice Hall",
+ year = 1978,
+}
+
+%% author: Family_name, Given_name Middle_name
+@book{kernighan88,
+ author = "Kernighan, Brian W. AND Ritchie, Dennis M.",
+ title = "The C Programming Language, 2nd edition",
+ publisher = PH,
+ year = 1988,
+}
+
+%% name with Jr
+@book{king63,
+ author = "King, Jr., Martin Luther",
+ title = "I Have a Dream!",
+ year = 1963,
+}
+
+%% Latin-1, name with nobiliary particle "von"
+@book{weber1821,
+ author = "Carl Maria von Weber",
+ title = "Der Freischütz",
+ year = 1821,
+}
+
+%% Japanese, separate names by "、", " "
+@book{bibunsho8,
+ author = {奥村  晴彦、黒木  裕介},
+ title = {[改訂第8版] LaTeX2ε美文書作成入門},
+ year = 2020,
+ publisher = 技評,
+ language = {ja},
+ yomi = {okumura}
+}
+
+%% Japanese, separate names by ",", " "
+@book{bibunsho7,
+ author = {奥村 晴彦,黒木  裕介},
+ title = {[改訂第7版] LaTeX2ε美文書作成入門},
+ year = 2017,
+ publisher = {技術評論社},
+ language = {ja},
+ yomi = {okumura}
+}
+
+%% Japanese
+@book{bibunsho6,
+ author = {奥村 晴彦 and 黒木 裕介},
+ title = {[改訂第6版] LaTeX2ε美文書作成入門},
+ year = 2013,
+ publisher = {技術評論社},
+ language = {ja},
+ yomi = {okumura}
+}
+
+%% Korean Hangul
+@book{kim-siseup,
+ author = "김 시습",
+ yomi = "Kim Si-seup",
+ title = "금오신화 (金鰲新話)",
+ year = "1494?",
+}
+
+%% Chinese
+@book{CaoXueQin,
+ author = "曹 雪芹",
+ title = "紅樓夢",
+}
+
+@book{JinPingMei,
+ author = "蘭陵笑笑生",
+ title = "金瓶梅",
+ year = 1610,
+}
+
+
+%% separate names by "、", "," and " "
+@book{test:misc0,
+ author = "テスト てすと and 名無 権兵衛、 何 誰兵衛, 無名  戦士 and John Smith and Schmidt, Hans",
+ yomi = "Tesuto Tesuto and Gombe Nanashi、 Darebe Nan,Senshi Mumei and John Smith and Hans Schmidt",
+ title = "UTF-8版jbibtexのテスト: ±α、β,γ。§абв.",
+ publisher = "Ω出版社",
+ year = 2007,
+}
+
+%% characters over BMP
+%% A BOM U+FEFF (Zero Width No-Break Space) is placed between "全" and "㐧"
+@book{髙島𠮷野,
+ author = {髙島 𠮷野、𡈽方  𠀋之助},
+ yomi = "Yoshino Takashima",
+ title = "𠷡と𩸽と‼夢か幻か⁇",
+ publisher = "安全㐧一",
+ isbn = "0-000000-00-0",
+ year = 2007,
+}
+
+%% Latin-1, name with nobiliary particle "de"
+@book{Lautréamont,
+ author = "Conte de Lautréamont",
+ title = "Les Chants de Maldoror",
+ year = 1868,
+}
+
+%% Latin-1
+@book{Proust,
+ author = "Marcel Proust",
+ title = "À la recherche du temps perdu",
+ publisher = "Éditions Gallimard",
+ year = "1913--1927",
+}
+
+@book{BrüderGrimm,
+ author = "Brüder Grimm",
+ title = "Kinder- und Hausmärchen",
+ publisher = "Reimer",
+ year = 1812,
+}
+
+@book{Camus,
+ author = "Albert Camus",
+ title = "L'Étranger",
+ publisher = ÉG,
+ year = 1942,
+}
+
+%% Cyrillic
+@book{Булгаков,
+ author = "Булгаков, Михаил Афанасьевич",
+ title = "Мастер и Маргарита",
+ year = 1966,
+}
+
+@book{Го́голь,
+ author = "Мико́ла Васи́льович Го́голь",
+ title = "Нос",
+ year = 1836,
+}
+
+%% Greek
+@book{Διογένης,
+ author = "Διογένης Λαέρτιος",
+ title = "Βίοι καὶ γνῶμαι τῶν ἐν φιλοσοφίᾳ εὐδοκιμησάντων",
+ year = "3C",
+}
+
diff --git a/biblio/bibtex/bibtex-x/tests/namea.aux b/biblio/bibtex/bibtex-x/tests/namea.aux
new file mode 100644
index 0000000000..579873640a
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/namea.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testname}
+\bibdata{ltnbib}
diff --git a/biblio/bibtex/bibtex-x/tests/namea.bbl b/biblio/bibtex/bibtex-x/tests/namea.bbl
new file mode 100644
index 0000000000..401c5adc0d
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/namea.bbl
@@ -0,0 +1,32 @@
+\section*{Test result}
+\begin{itemize}
+\item Albert Camus
+ [1] {ff} Albert {ll} Camus {vv} {jj}
+ | AlbertCamus | Albert Camus | Camus, A. | A.~Camus
+\item Brian Wilson Kernighan and Dennis MacAlistair Ritchie
+ [1] {ff} Brian~Wilson {ll} Kernighan {vv} {jj}
+ | Brian~WilsonKernighan | Brian~Wilson Kernighan | Kernighan, B.~W. | B.~W. Kernighan
+ [2] {ff} Dennis~MacAlistair {ll} Ritchie {vv} {jj}
+ | Dennis~MacAlistairRitchie | Dennis~MacAlistair Ritchie | Ritchie, D.~M. | D.~M. Ritchie
+\item Brder Grimm
+ [1] {ff} Brder {ll} Grimm {vv} {jj}
+ | BrderGrimm | Brder Grimm | Grimm, B. | B.~Grimm
+\item Carl Maria von Weber
+ [1] {ff} Carl~Maria {ll} Weber {vv} von {jj}
+ | Carl~MariavonWeber | Carl~Maria von Weber | von Weber, C.~M. | C.~M. v.~Weber
+\item Conte de Lautramont
+ [1] {ff} Conte {ll} Lautramont {vv} de {jj}
+ | ContedeLautramont | Conte de Lautramont | de~Lautramont, C. | C.~d.~Lautramont
+\item Kernighan, Brian W. AND Ritchie, Dennis M.
+ [1] {ff} Brian~W. {ll} Kernighan {vv} {jj}
+ | Brian~W.Kernighan | Brian~W. Kernighan | Kernighan, B.~W. | B.~W. Kernighan
+ [2] {ff} Dennis~M. {ll} Ritchie {vv} {jj}
+ | Dennis~M.Ritchie | Dennis~M. Ritchie | Ritchie, D.~M. | D.~M. Ritchie
+\item King, Jr., Martin Luther
+ [1] {ff} Martin~Luther {ll} King {vv} {jj} Jr.
+ | Martin~LutherKingJr. | Martin~Luther King Jr. | King, Jr., M.~L. | M.~L. King, Jr.
+\item Marcel Proust
+ [1] {ff} Marcel {ll} Proust {vv} {jj}
+ | MarcelProust | Marcel Proust | Proust, M. | M.~Proust
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/nameu.aux b/biblio/bibtex/bibtex-x/tests/nameu.aux
new file mode 100644
index 0000000000..61c5df1d5b
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/nameu.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testname}
+\bibdata{mlgbib}
diff --git a/biblio/bibtex/bibtex-x/tests/nameu.bbl b/biblio/bibtex/bibtex-x/tests/nameu.bbl
new file mode 100644
index 0000000000..7115360ff7
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/nameu.bbl
@@ -0,0 +1,85 @@
+\section*{Test result}
+\begin{itemize}
+\item Albert Camus
+ [1] {ff} Albert {ll} Camus {vv} {jj}
+ | AlbertCamus | Albert Camus | Camus, A. | A.~Camus
+\item Brian Wilson Kernighan and Dennis MacAlistair Ritchie
+ [1] {ff} Brian~Wilson {ll} Kernighan {vv} {jj}
+ | Brian~WilsonKernighan | Brian~Wilson Kernighan | Kernighan, B.~W. | B.~W. Kernighan
+ [2] {ff} Dennis~MacAlistair {ll} Ritchie {vv} {jj}
+ | Dennis~MacAlistairRitchie | Dennis~MacAlistair Ritchie | Ritchie, D.~M. | D.~M. Ritchie
+\item Brüder Grimm
+ [1] {ff} Brüder {ll} Grimm {vv} {jj}
+ | BrüderGrimm | Brüder Grimm | Grimm, B. | B.~Grimm
+\item Carl Maria von Weber
+ [1] {ff} Carl~Maria {ll} Weber {vv} von {jj}
+ | Carl~MariavonWeber | Carl~Maria von Weber | von Weber, C.~M. | C.~M. v.~Weber
+\item Conte de Lautréamont
+ [1] {ff} Conte {ll} Lautréamont {vv} de {jj}
+ | ContedeLautréamont | Conte de Lautréamont | de~Lautréamont, C. | C.~d.~Lautréamont
+\item Kernighan, Brian W. AND Ritchie, Dennis M.
+ [1] {ff} Brian~W. {ll} Kernighan {vv} {jj}
+ | Brian~W.Kernighan | Brian~W. Kernighan | Kernighan, B.~W. | B.~W. Kernighan
+ [2] {ff} Dennis~M. {ll} Ritchie {vv} {jj}
+ | Dennis~M.Ritchie | Dennis~M. Ritchie | Ritchie, D.~M. | D.~M. Ritchie
+\item King, Jr., Martin Luther
+ [1] {ff} Martin~Luther {ll} King {vv} {jj} Jr.
+ | Martin~LutherKingJr. | Martin~Luther King Jr. | King, Jr., M.~L. | M.~L. King, Jr.
+\item Marcel Proust
+ [1] {ff} Marcel {ll} Proust {vv} {jj}
+ | MarcelProust | Marcel Proust | Proust, M. | M.~Proust
+\item Διογένης Λαέρτιος
+ [1] {ff} Διογένης {ll} Λαέρτιος {vv} {jj}
+ | ΔιογένηςΛαέρτιος | Διογένης Λαέρτιος | Λαέρτιος, Δ. | Δ. Λαέρτιος
+\item Булгаков, Михаил Афанасьевич
+ [1] {ff} Михаил~Афанасьевич {ll} Булгаков {vv} {jj}
+ | Михаил~АфанасьевичБулгаков | Михаил~Афанасьевич Булгаков |
+ Булгаков, М.~А. | М.~А. Булгаков
+\item Мико́ла Васи́льович Го́голь
+ [1] {ff} Мико́ла~Васи́льович {ll} Го́голь {vv} {jj}
+ | Мико́ла~Васи́льовичГо́голь | Мико́ла~Васи́льович Го́голь |
+ Го́голь, М.~В. | М.~В. Го́голь
+\item 김 시습
+ [1] {ff} 김 {ll} 시습 {vv} {jj}
+ | 김시습 | 김 시습 | 시습, 김. | 김. 시습
+\item テスト てすと and 名無 権兵衛、 何 誰兵衛, 無名  戦士 and John Smith and Schmidt, Hans
+ [1] {ff} テスト {ll} てすと {vv} {jj}
+ | テストてすと | テスト てすと | てすと, テ. | テ. てすと
+ [2] {ff} 名無 {ll} 権兵衛 {vv} {jj}
+ | 名無権兵衛 | 名無 権兵衛 | 権兵衛, 名. | 名. 権兵衛
+ [3] {ff} 何 {ll} 誰兵衛 {vv} {jj}
+ | 何誰兵衛 | 何 誰兵衛 | 誰兵衛, 何. | 何. 誰兵衛
+ [4] {ff} 無名 {ll} 戦士 {vv} {jj}
+ | 無名戦士 | 無名 戦士 | 戦士, 無. | 無. 戦士
+ [5] {ff} John {ll} Smith {vv} {jj}
+ | JohnSmith | John Smith | Smith, J. | J.~Smith
+ [6] {ff} Hans {ll} Schmidt {vv} {jj}
+ | HansSchmidt | Hans Schmidt | Schmidt, H. | H.~Schmidt
+\item 奥村 晴彦,黒木  裕介
+ [1] {ff} 奥村 {ll} 晴彦 {vv} {jj}
+ | 奥村晴彦 | 奥村 晴彦 | 晴彦, 奥. | 奥. 晴彦
+ [2] {ff} 黒木 {ll} 裕介 {vv} {jj}
+ | 黒木裕介 | 黒木 裕介 | 裕介, 黒. | 黒. 裕介
+\item 奥村  晴彦、黒木  裕介
+ [1] {ff} 奥村 {ll} 晴彦 {vv} {jj}
+ | 奥村晴彦 | 奥村 晴彦 | 晴彦, 奥. | 奥. 晴彦
+ [2] {ff} 黒木 {ll} 裕介 {vv} {jj}
+ | 黒木裕介 | 黒木 裕介 | 裕介, 黒. | 黒. 裕介
+\item 奥村 晴彦 and 黒木 裕介
+ [1] {ff} 奥村 {ll} 晴彦 {vv} {jj}
+ | 奥村晴彦 | 奥村 晴彦 | 晴彦, 奥. | 奥. 晴彦
+ [2] {ff} 黒木 {ll} 裕介 {vv} {jj}
+ | 黒木裕介 | 黒木 裕介 | 裕介, 黒. | 黒. 裕介
+\item 曹 雪芹
+ [1] {ff} 曹 {ll} 雪芹 {vv} {jj}
+ | 曹雪芹 | 曹 雪芹 | 雪芹, 曹. | 曹. 雪芹
+\item 蘭陵笑笑生
+ [1] {ff} {ll} 蘭陵笑笑生 {vv} {jj}
+ | 蘭陵笑笑生 | 蘭陵笑笑生 | 蘭陵笑笑生 | 蘭陵笑笑生
+\item 髙島 𠮷野、𡈽方  𠀋之助
+ [1] {ff} 髙島 {ll} 𠮷野 {vv} {jj}
+ | 髙島𠮷野 | 髙島 𠮷野 | 𠮷野, 髙. | 髙. 𠮷野
+ [2] {ff} 𡈽方 {ll} 𠀋之助 {vv} {jj}
+ | 𡈽方𠀋之助 | 𡈽方 𠀋之助 | 𠀋之助, 𡈽. | 𡈽. 𠀋之助
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/perioda.aux b/biblio/bibtex/bibtex-x/tests/perioda.aux
new file mode 100644
index 0000000000..a2d909eb7f
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/perioda.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testperiod}
+\bibdata{testperioda}
diff --git a/biblio/bibtex/bibtex-x/tests/perioda.bbl b/biblio/bibtex/bibtex-x/tests/perioda.bbl
new file mode 100644
index 0000000000..b240df41b3
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/perioda.bbl
@@ -0,0 +1,18 @@
+\section*{Test result}
+\begin{itemize}
+\item[~~] ABC xyz
+\item[ap] ABC xyz.
+\item[~~] ABC xyz.
+\item[ap] ABC xyz.
+\item[~~] ABC xyz!
+\item[ap] ABC xyz!
+\item[~~] ABC xyz?
+\item[ap] ABC xyz?
+\item[~~] ABC xyz,
+\item[ap] ABC xyz,.
+\item[~~] ABC {xyz!}
+\item[ap] ABC {xyz!}
+\item[~~] ABC {{xyz?}}
+\item[ap] ABC {{xyz?}}
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/periodu.aux b/biblio/bibtex/bibtex-x/tests/periodu.aux
new file mode 100644
index 0000000000..5378057320
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/periodu.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testperiod}
+\bibdata{testperiodu}
diff --git a/biblio/bibtex/bibtex-x/tests/periodu.bbl b/biblio/bibtex/bibtex-x/tests/periodu.bbl
new file mode 100644
index 0000000000..8672593a22
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/periodu.bbl
@@ -0,0 +1,64 @@
+\section*{Test result}
+\begin{itemize}
+\item[~~] ABC xyz
+\item[ap] ABC xyz.
+\item[~~] ABC xyz!
+\item[ap] ABC xyz!
+\item[~~] ABC xyz,
+\item[ap] ABC xyz,.
+\item[~~] ABC xyz.
+\item[ap] ABC xyz.
+\item[~~] ABC xyz?
+\item[ap] ABC xyz?
+\item[~~] ABC {xyz!}
+\item[ap] ABC {xyz!}
+\item[~~] ABC {{xyz?}}
+\item[ap] ABC {{xyz?}}
+\item[~~] АБВ {{эюя?}}
+\item[ap] АБВ {{эюя?}}
+\item[~~] АБВ {эюя!}
+\item[ap] АБВ {эюя!}
+\item[~~] АБВ эюя
+\item[ap] АБВ эюя.
+\item[~~] АБВ эюя!
+\item[ap] АБВ эюя!
+\item[~~] АБВ эюя,
+\item[ap] АБВ эюя,.
+\item[~~] АБВ эюя.
+\item[ap] АБВ эюя.
+\item[~~] АБВ эюя?
+\item[ap] АБВ эюя?
+\item[~~] あいうわ{{{{おん⁇}}}}
+\item[ap] あいうわ{{{{おん⁇}}}}
+\item[~~] あいうわ{{{おん‼}}}
+\item[ap] あいうわ{{{おん‼}}}
+\item[~~] あいうわ{{おん?}}
+\item[ap] あいうわ{{おん?}}
+\item[~~] あいうわ{おん!}
+\item[ap] あいうわ{おん!}
+\item[~~] あいうわおん
+\item[ap] あいうわおん.
+\item[~~] あいうわおん,
+\item[ap] あいうわおん,.
+\item[~~] あいうわおん、
+\item[ap] あいうわおん、.
+\item[~~] あいうわおん!
+\item[ap] あいうわおん!
+\item[~~] あいうわおん‼
+\item[ap] あいうわおん‼
+\item[~~] あいうわおん⁉
+\item[ap] あいうわおん⁉
+\item[~~] あいうわおん?
+\item[ap] あいうわおん?
+\item[~~] あいうわおん⁈
+\item[ap] あいうわおん⁈
+\item[~~] あいうわおん⁇
+\item[ap] あいうわおん⁇
+\item[~~] あいうわおん‽
+\item[ap] あいうわおん‽
+\item[~~] あいうわおん.
+\item[ap] あいうわおん.
+\item[~~] あいうわおん。
+\item[ap] あいうわおん。
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/sort.aux b/biblio/bibtex/bibtex-x/tests/sort.aux
new file mode 100644
index 0000000000..8b9b435001
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sort.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{teststyle}
+\bibdata{testdata}
diff --git a/biblio/bibtex/bibtex-x/tests/sort1.bbl b/biblio/bibtex/bibtex-x/tests/sort1.bbl
new file mode 100644
index 0000000000..4cee697749
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sort1.bbl
@@ -0,0 +1,15 @@
+\section*{Test result}
+\begin{itemize}
+\item Aa AA aa
+\item
+\item
+\item Bb BB bb
+\item Cc CC cc
+\item Oo OO oo
+\item
+\item
+\item Xx XX xx
+\item Yy YY yy
+\item Zz ZZ zz
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/sort1.csf b/biblio/bibtex/bibtex-x/tests/sort1.csf
new file mode 100644
index 0000000000..8871a2eb4b
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sort1.csf
@@ -0,0 +1,275 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% CHARACTER SET: ISO 8859-1 (Latin 1)
+%
+% ISO 8859-1 is the system character set used by Unix/X Windows and
+% MS Windows.
+%
+% SORTING ORDER: Latin countries
+%
+% Alphabetical sorting order of Aa..Zz (including accented characters).
+%
+% This is a BibTeX Codepage and Sort definition file (CSF). It is
+% used to define the 8-bit character set used by BibTeX and the
+% order in which those characters should be sorted. The file
+% format is documented below this header section.
+%
+% This file will only work with the 8-bit implementation of BibTeX
+% written by Niel Kempson and Alejandro Aguilar-Sierra:
+%
+% http://www.ctan.org/tex-archive/biblio/bibtex/8-bit/
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% FILE FORMAT
+%
+% The codepage and sorting order (CS) file defines how BibTeX will treat an
+% 8-bit character set, specifically which characters are to be treated as
+% letters, the upper/lower case relationships between characters, and the
+% sorting order of characters.
+%
+% The CS file may contain a number of sections, each presented in the
+% form of a TeX macro:
+%
+% \section-name{
+% <section definitions>
+% }
+%
+% Four sections are currently supported: \lowupcase, \lowercase, \uppercase
+% and \order. The syntax of the four supported sections is summarised below.
+%
+% 8-bit characters may be entered naturally, but to avoid problems with
+% character set translation or corruption, they can also be entered using
+% the TeX-style portable notation for character codes, i.e. ^^XX, where XX
+% is the hexadecimal value ofthe character code.
+%
+% Reading of the sections ends when the first '}' character is reached, so
+% '}' can't be included in a section. You can't use ^^7d either.
+%
+% The percent sign ('%') is used to introduce a trailing comment - it and
+% all remaining characters on a line are ignored. ^^25 has the same effect.
+%
+%
+% \lowupcase section
+%
+% The \lowupcase section of the CS file is used to define the lower
+% /upper and upper/lower case relationship of pairs of specified
+% characters. It is only used if the relationship is symmetrical - use
+% \lowercase or \upcase if it isn't.
+%
+% The syntax of the \lowupcase section is:
+%
+% \lowupcase{
+% <LC-1> <UC-1> % Comment begins with a percent sign
+% <LC-2> <UC-2>
+% ...
+% <LC-N> <UC-N>
+% }
+%
+% Each <LC-n> <UC-n> pair of characters defines that the upper case
+% equivalent of <LC-n> is <UC-n> *and* the lower case equivalent of
+% <UC-n> is <LC-n>.
+%
+% You cannot redefine the lower or upper case equivalent of an ASCII
+% character (code < 128), so all instances of <LC-n> and <UC-n>
+% (i.e. both sides of the relationship) must have codes > 127.
+%
+%
+% \lowercase section
+%
+% The \lowercase section of the CS file is used to define the lower case
+% equivalent of specified characters. It should normally only be used
+% if the relationship isn't symmetrical - use \lowupcase if it is.
+%
+% The syntax of the \lowercase section is:
+%
+% \lowercase{
+% <UC-1> <LC-1> % Comment begins with a percent sign
+% <UC-2> <LC-2>
+% ...
+% <UC-N> <LC-N>
+% }
+%
+% Each <LC-n> <UC-n> pair of characters defines that the lower case
+% equivalent of <UC-n> is <LC-n>.
+%
+% You cannot redefine the lower case equivalent of an ASCII character
+% (code < 128), so all instances of <UC-n> (i.e. the left hand side
+% of the relationship) must have codes > 127.
+%
+%
+% \uppercase section
+%
+% The \uppercase section of the CS file is used to define the upper case
+% equivalent of specified characters. It should normally only be used
+% if the relationship isn't symmetrical - use \lowupcase if it is.
+%
+% The syntax of the \uppercase section is:
+%
+% \uppercase{
+% <LC-1> <UC-1> % Comment begins with a percent sign
+% <LC-2> <UC-2>
+% ...
+% <LC-N> <UC-N>
+% }
+%
+% Each <LC-n> <UC-n> pair of characters defines that the upper case
+% case equivalent of <LC-n> is <UC-n>.
+%
+% You cannot redefine the upper case equivalent of an ASCII character
+% (code < 128), so all instances of <LC-n> (i.e. the left hand side
+% of the relationship) must have codes > 127.
+%
+%
+% \order section
+%
+% The \order section of the CS file is used to define the order in which
+% characters are sorted.
+%
+% The syntax of the \order section is:
+%
+% \order{
+% <char-1> % Comment begins with a percent sign
+% <char-2> <char-3> % whitespace between the chars
+% <char-4> - <char-5> % a hyphen between the chars
+% <char-4> _ <char-5> % an underscore between the chars
+% ...
+% <char-n>
+% }
+%
+% All characters on the same line are given the same sorting weight.
+%
+% The construct <char-1> <underscore> <char-2> is used to denote that
+% all characters in the range <char-1> to <char-2> should be given the
+% same sorting weight. For example, "A _ Z" would cause all ASCII
+% upper case alphabetical characters to have the same sorting weight
+% and would be equivalent to placing all 26 characters on the same line.
+%
+% The construct <char-1> <hyphen> <char-2> is used to denote that all
+% characters in the range <char-1> to <char-2> should be given an
+% ascending set of sorting weights, starting with <char-1> and ending
+% with <char-2>. For example, "A - Z" would cause all upper case ASCII
+% alphabetical characters to be sorted in ascending order and would be
+% equivalent to placing 'A' on the first line, 'B' on the second,
+% through to 'Z' on the 26th line.
+%
+% The characters at the beginning of the order section are given a lower
+% sorting weight than characters occuring later. When sorting
+% alphabetically, characters with the lowest weight come first.
+%
+% All characters not in the \order section (including ASCII characters)
+% are given the same very high sorting weight to ensure that they come
+% last when sorting alphabetically.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% CHARACTER SET
+
+\lowupcase{ % Lowercase Uppercase
+ % Code TeX Code TeX
+ %
+ % ^^e0 \`{a} ^^c0 \`{A}
+ % ^^e1 \'{a} ^^c1 \'{A}
+ % ^^e2 \^{a} ^^c2 \^{A}
+ % ^^e3 \~{a} ^^c3 \~{A}
+ % ^^e4 \"{a} ^^c4 \"{A}
+ % ^^e5 \aa ^^c5 \AA
+ % ^^e6 \ae ^^c6 \AE
+ % ^^e7 \c{c} ^^c7 \c{C}
+ % ^^e8 \`{e} ^^c8 \`{E}
+ % ^^e9 \'{e} ^^c9 \'{E}
+ % ^^ea \^{e} ^^ca \^{E}
+ % ^^eb \"{e} ^^cb \"{E}
+ % ^^ec \`{\i} ^^cc \`{I}
+ % ^^ed \'{\i} ^^cd \'{I}
+ % ^^ee \^{\i} ^^ce \^{I}
+ % ^^ef \"{\i} ^^cf \"{I}
+ % ^^f0 \dh ^^d0 \DH
+ % ^^f1 \~{n} ^^d1 \~{N}
+ % ^^f2 \`{o} ^^d2 \`{O}
+ % ^^f3 \'{o} ^^d3 \'{O}
+ % ^^f4 \^{o} ^^d4 \^{O}
+ % ^^f5 \~{o} ^^d5 \~{O}
+ % ^^f6 \"{o} ^^d6 \"{O}
+ % ^^f8 \o ^^d8 \O
+ % ^^f9 \`{u} ^^d9 \`{U}
+ % ^^fa \'{u} ^^da \'{U}
+ % ^^fb \^{u} ^^db \^{U}
+ % ^^fc \"{u} ^^dc \"{U}
+ % ^^fd \'{y} ^^dd \'{Y}
+ % ^^fe \th ^^de \TH
+}
+
+% SORTING ORDER
+
+\order{
+ 0-9
+ A
+
+ a
+
+ B
+ b
+ C
+ c
+ D
+ d
+ E
+
+ e
+
+ F
+ f
+ G
+ g
+ H
+ h
+ I
+
+ i
+
+ J
+ j
+ K
+ k
+ L
+ l
+ M
+ m
+ N
+ n
+ O
+
+ o
+
+ P
+ p
+ Q
+ q
+ R
+ r
+ S
+ s
+ T
+ t
+ U
+
+ u
+
+ V
+ v
+ W
+ w
+ X
+ x
+ Y
+
+ y
+
+ Z
+ z
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% END OF FILE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/biblio/bibtex/bibtex-x/tests/sort2.bbl b/biblio/bibtex/bibtex-x/tests/sort2.bbl
new file mode 100644
index 0000000000..15464fe5b1
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sort2.bbl
@@ -0,0 +1,15 @@
+\section*{Test result}
+\begin{itemize}
+\item Aa AA aa
+\item
+\item Bb BB bb
+\item Cc CC cc
+\item Oo OO oo
+\item
+\item Xx XX xx
+\item Yy YY yy
+\item Zz ZZ zz
+\item
+\item
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/sort2.csf b/biblio/bibtex/bibtex-x/tests/sort2.csf
new file mode 100644
index 0000000000..6ac91cd744
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sort2.csf
@@ -0,0 +1,114 @@
+% CHARACTER SET
+
+\lowupcase{ % Lowercase Uppercase
+ % Code TeX Code TeX
+ %
+ % ^^e0 \`{a} ^^c0 \`{A}
+ % ^^e1 \'{a} ^^c1 \'{A}
+ % ^^e2 \^{a} ^^c2 \^{A}
+ % ^^e3 \~{a} ^^c3 \~{A}
+ % ^^e4 \"{a} ^^c4 \"{A}
+ % ^^e5 \aa ^^c5 \AA
+ % ^^e6 \ae ^^c6 \AE
+ % ^^e7 \c{c} ^^c7 \c{C}
+ % ^^e8 \`{e} ^^c8 \`{E}
+ % ^^e9 \'{e} ^^c9 \'{E}
+ % ^^ea \^{e} ^^ca \^{E}
+ % ^^eb \"{e} ^^cb \"{E}
+ % ^^ec \`{\i} ^^cc \`{I}
+ % ^^ed \'{\i} ^^cd \'{I}
+ % ^^ee \^{\i} ^^ce \^{I}
+ % ^^ef \"{\i} ^^cf \"{I}
+ % ^^f0 \dh ^^d0 \DH
+ % ^^f1 \~{n} ^^d1 \~{N}
+ % ^^f2 \`{o} ^^d2 \`{O}
+ % ^^f3 \'{o} ^^d3 \'{O}
+ % ^^f4 \^{o} ^^d4 \^{O}
+ % ^^f5 \~{o} ^^d5 \~{O}
+ % ^^f6 \"{o} ^^d6 \"{O}
+ % ^^f8 \o ^^d8 \O
+ % ^^f9 \`{u} ^^d9 \`{U}
+ % ^^fa \'{u} ^^da \'{U}
+ % ^^fb \^{u} ^^db \^{U}
+ % ^^fc \"{u} ^^dc \"{U}
+ % ^^fd \'{y} ^^dd \'{Y}
+ % ^^fe \th ^^de \TH
+}
+
+% SORTING ORDER
+
+\order{
+ 0-9
+ A
+
+ a
+
+ B
+ b
+ C
+ c
+ D
+ d
+ E
+
+ e
+
+ F
+ f
+ G
+ g
+ H
+ h
+ I
+
+ i
+
+ J
+ j
+ K
+ k
+ L
+ l
+ M
+ m
+ N
+ n
+ O
+
+ o
+
+ P
+ p
+ Q
+ q
+ R
+ r
+ S
+ s
+ T
+ t
+ U
+
+ u
+
+ V
+ v
+ W
+ w
+ X
+ x
+ Y
+
+ y
+
+ Z
+ z
+
+
+
+
+
+
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% END OF FILE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/biblio/bibtex/bibtex-x/tests/sort3.bbl b/biblio/bibtex/bibtex-x/tests/sort3.bbl
new file mode 100644
index 0000000000..a2ec3bea9b
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sort3.bbl
@@ -0,0 +1,15 @@
+\section*{Test result}
+\begin{itemize}
+\item Aa AA aa
+\item Bb BB bb
+\item Cc CC cc
+\item Oo OO oo
+\item
+\item Xx XX xx
+\item Yy YY yy
+\item Zz ZZ zz
+\item
+\item
+\item
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/sort3.csf b/biblio/bibtex/bibtex-x/tests/sort3.csf
new file mode 100644
index 0000000000..909cf0f60e
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sort3.csf
@@ -0,0 +1,281 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% CHARACTER SET: ISO 8859-1 (Latin 1)
+%
+% ISO 8859-1 is the system character set used by Unix/X Windows and
+% MS Windows.
+%
+% SORTING ORDER: Swedish
+%
+% Alphabetical sorting order of Aa..Zz (including accented characters).
+%
+% This is a BibTeX Codepage and Sort definition file (CSF). It is
+% used to define the 8-bit character set used by BibTeX and the
+% order in which those characters should be sorted. The file
+% format is documented below this header section.
+%
+% This file will only work with the 8-bit implementation of BibTeX
+% written by Niel Kempson and Alejandro Aguilar-Sierra:
+%
+% http://www.ctan.org/tex-archive/biblio/bibtex/8-bit/
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% FILE FORMAT
+%
+% The codepage and sorting order (CS) file defines how BibTeX will treat an
+% 8-bit character set, specifically which characters are to be treated as
+% letters, the upper/lower case relationships between characters, and the
+% sorting order of characters.
+%
+% The CS file may contain a number of sections, each presented in the
+% form of a TeX macro:
+%
+% \section-name{
+% <section definitions>
+% }
+%
+% Four sections are currently supported: \lowupcase, \lowercase, \uppercase
+% and \order. The syntax of the four supported sections is summarised below.
+%
+% 8-bit characters may be entered naturally, but to avoid problems with
+% character set translation or corruption, they can also be entered using
+% the TeX-style portable notation for character codes, i.e. ^^XX, where XX
+% is the hexadecimal value ofthe character code.
+%
+% Reading of the sections ends when the first '}' character is reached, so
+% '}' can't be included in a section. You can't use ^^7d either.
+%
+% The percent sign ('%') is used to introduce a trailing comment - it and
+% all remaining characters on a line are ignored. ^^25 has the same effect.
+%
+%
+% \lowupcase section
+%
+% The \lowupcase section of the CS file is used to define the lower
+% /upper and upper/lower case relationship of pairs of specified
+% characters. It is only used if the relationship is symmetrical - use
+% \lowercase or \upcase if it isn't.
+%
+% The syntax of the \lowupcase section is:
+%
+% \lowupcase{
+% <LC-1> <UC-1> % Comment begins with a percent sign
+% <LC-2> <UC-2>
+% ...
+% <LC-N> <UC-N>
+% }
+%
+% Each <LC-n> <UC-n> pair of characters defines that the upper case
+% equivalent of <LC-n> is <UC-n> *and* the lower case equivalent of
+% <UC-n> is <LC-n>.
+%
+% You cannot redefine the lower or upper case equivalent of an ASCII
+% character (code < 128), so all instances of <LC-n> and <UC-n>
+% (i.e. both sides of the relationship) must have codes > 127.
+%
+%
+% \lowercase section
+%
+% The \lowercase section of the CS file is used to define the lower case
+% equivalent of specified characters. It should normally only be used
+% if the relationship isn't symmetrical - use \lowupcase if it is.
+%
+% The syntax of the \lowercase section is:
+%
+% \lowercase{
+% <UC-1> <LC-1> % Comment begins with a percent sign
+% <UC-2> <LC-2>
+% ...
+% <UC-N> <LC-N>
+% }
+%
+% Each <LC-n> <UC-n> pair of characters defines that the lower case
+% equivalent of <UC-n> is <LC-n>.
+%
+% You cannot redefine the lower case equivalent of an ASCII character
+% (code < 128), so all instances of <UC-n> (i.e. the left hand side
+% of the relationship) must have codes > 127.
+%
+%
+% \uppercase section
+%
+% The \uppercase section of the CS file is used to define the upper case
+% equivalent of specified characters. It should normally only be used
+% if the relationship isn't symmetrical - use \lowupcase if it is.
+%
+% The syntax of the \uppercase section is:
+%
+% \uppercase{
+% <LC-1> <UC-1> % Comment begins with a percent sign
+% <LC-2> <UC-2>
+% ...
+% <LC-N> <UC-N>
+% }
+%
+% Each <LC-n> <UC-n> pair of characters defines that the upper case
+% case equivalent of <LC-n> is <UC-n>.
+%
+% You cannot redefine the upper case equivalent of an ASCII character
+% (code < 128), so all instances of <LC-n> (i.e. the left hand side
+% of the relationship) must have codes > 127.
+%
+%
+% \order section
+%
+% The \order section of the CS file is used to define the order in which
+% characters are sorted.
+%
+% The syntax of the \order section is:
+%
+% \order{
+% <char-1> % Comment begins with a percent sign
+% <char-2> <char-3> % whitespace between the chars
+% <char-4> - <char-5> % a hyphen between the chars
+% <char-4> _ <char-5> % an underscore between the chars
+% ...
+% <char-n>
+% }
+%
+% All characters on the same line are given the same sorting weight.
+%
+% The construct <char-1> <underscore> <char-2> is used to denote that
+% all characters in the range <char-1> to <char-2> should be given the
+% same sorting weight. For example, "A _ Z" would cause all ASCII
+% upper case alphabetical characters to have the same sorting weight
+% and would be equivalent to placing all 26 characters on the same line.
+%
+% The construct <char-1> <hyphen> <char-2> is used to denote that all
+% characters in the range <char-1> to <char-2> should be given an
+% ascending set of sorting weights, starting with <char-1> and ending
+% with <char-2>. For example, "A - Z" would cause all upper case ASCII
+% alphabetical characters to be sorted in ascending order and would be
+% equivalent to placing 'A' on the first line, 'B' on the second,
+% through to 'Z' on the 26th line.
+%
+% The characters at the beginning of the order section are given a lower
+% sorting weight than characters occuring later. When sorting
+% alphabetically, characters with the lowest weight come first.
+%
+% All characters not in the \order section (including ASCII characters)
+% are given the same very high sorting weight to ensure that they come
+% last when sorting alphabetically.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% CHARACTER SET
+
+\lowupcase{ % Lowercase Uppercase
+ % Code TeX Code TeX
+ %
+ % ^^e0 \`{a} ^^c0 \`{A}
+ % ^^e1 \'{a} ^^c1 \'{A}
+ % ^^e2 \^{a} ^^c2 \^{A}
+ % ^^e3 \~{a} ^^c3 \~{A}
+ % ^^e4 \"{a} ^^c4 \"{A}
+ % ^^e5 \aa ^^c5 \AA
+ % ^^e6 \ae ^^c6 \AE
+ % ^^e7 \c{c} ^^c7 \c{C}
+ % ^^e8 \`{e} ^^c8 \`{E}
+ % ^^e9 \'{e} ^^c9 \'{E}
+ % ^^ea \^{e} ^^ca \^{E}
+ % ^^eb \"{e} ^^cb \"{E}
+ % ^^ec \`{\i} ^^cc \`{I}
+ % ^^ed \'{\i} ^^cd \'{I}
+ % ^^ee \^{\i} ^^ce \^{I}
+ % ^^ef \"{\i} ^^cf \"{I}
+ % ^^f0 \dh ^^d0 \DH
+ % ^^f1 \~{n} ^^d1 \~{N}
+ % ^^f2 \`{o} ^^d2 \`{O}
+ % ^^f3 \'{o} ^^d3 \'{O}
+ % ^^f4 \^{o} ^^d4 \^{O}
+ % ^^f5 \~{o} ^^d5 \~{O}
+ % ^^f6 \"{o} ^^d6 \"{O}
+ % ^^f8 \o ^^d8 \O
+ % ^^f9 \`{u} ^^d9 \`{U}
+ % ^^fa \'{u} ^^da \'{U}
+ % ^^fb \^{u} ^^db \^{U}
+ % ^^fc \"{u} ^^dc \"{U}
+ % ^^fd \'{y} ^^dd \'{Y}
+ % ^^fe \th ^^de \TH
+}
+
+% SORTING ORDER
+
+\order{
+ 0-9
+ A
+
+ a
+
+ B
+ b
+ C
+ c
+ D
+ d
+ E
+
+ e
+
+ F
+ f
+ G
+ g
+ H
+ h
+ I
+
+ i
+
+ J
+ j
+ K
+ k
+ L
+ l
+ M
+ m
+ N
+ n
+ O
+
+ o
+
+ P
+ p
+ Q
+ q
+ R
+ r
+ S
+ s
+ T
+ t
+ U
+
+ u
+
+ V
+ v
+ W
+ w
+ X
+ x
+ Y
+
+ y
+
+ Z
+ z
+
+
+
+
+
+
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% END OF FILE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/biblio/bibtex/bibtex-x/tests/sortu-az.bbl b/biblio/bibtex/bibtex-x/tests/sortu-az.bbl
new file mode 100644
index 0000000000..c9cb3ea758
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sortu-az.bbl
@@ -0,0 +1,27 @@
+\section*{Test result}
+\begin{itemize}
+\item Aa AA aa
+\item Åå ÅÅ åå
+\item Ää ÄÄ ää
+\item Bb BB bb
+\item Cc CC cc
+\item Xx XX xx
+\item Oo OO oo
+\item Øø ØØ øø
+\item Öö ÖÖ öö
+\item Yy YY yy
+\item Zz ZZ zz
+\item Аа АА аа
+\item Бб ББ бб
+\item Вв ВВ вв
+\item Ээ ЭЭ ээ
+\item Юю ЮЮ юю
+\item Яя ЯЯ яя
+\item Αα ΑΑ αα
+\item Ββ ΒΒ ββ
+\item Γγ ΓΓ γγ
+\item Χχ ΧΧ χχ
+\item Ψψ ΨΨ ψψ
+\item Ωω ΩΩ ωω
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/sortu-da.bbl b/biblio/bibtex/bibtex-x/tests/sortu-da.bbl
new file mode 100644
index 0000000000..c9f0485add
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sortu-da.bbl
@@ -0,0 +1,27 @@
+\section*{Test result}
+\begin{itemize}
+\item Bb BB bb
+\item Cc CC cc
+\item Oo OO oo
+\item Xx XX xx
+\item Yy YY yy
+\item Zz ZZ zz
+\item Ää ÄÄ ää
+\item Øø ØØ øø
+\item Öö ÖÖ öö
+\item Aa AA aa
+\item Åå ÅÅ åå
+\item Αα ΑΑ αα
+\item Ββ ΒΒ ββ
+\item Γγ ΓΓ γγ
+\item Χχ ΧΧ χχ
+\item Ψψ ΨΨ ψψ
+\item Ωω ΩΩ ωω
+\item Аа АА аа
+\item Бб ББ бб
+\item Вв ВВ вв
+\item Ээ ЭЭ ээ
+\item Юю ЮЮ юю
+\item Яя ЯЯ яя
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/sortu-en.bbl b/biblio/bibtex/bibtex-x/tests/sortu-en.bbl
new file mode 100644
index 0000000000..53f24ba70d
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sortu-en.bbl
@@ -0,0 +1,27 @@
+\section*{Test result}
+\begin{itemize}
+\item Aa AA aa
+\item Åå ÅÅ åå
+\item Ää ÄÄ ää
+\item Bb BB bb
+\item Cc CC cc
+\item Oo OO oo
+\item Öö ÖÖ öö
+\item Øø ØØ øø
+\item Xx XX xx
+\item Yy YY yy
+\item Zz ZZ zz
+\item Αα ΑΑ αα
+\item Ββ ΒΒ ββ
+\item Γγ ΓΓ γγ
+\item Χχ ΧΧ χχ
+\item Ψψ ΨΨ ψψ
+\item Ωω ΩΩ ωω
+\item Аа АА аа
+\item Бб ББ бб
+\item Вв ВВ вв
+\item Ээ ЭЭ ээ
+\item Юю ЮЮ юю
+\item Яя ЯЯ яя
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/sortu-fi.bbl b/biblio/bibtex/bibtex-x/tests/sortu-fi.bbl
new file mode 100644
index 0000000000..db180ee186
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sortu-fi.bbl
@@ -0,0 +1,27 @@
+\section*{Test result}
+\begin{itemize}
+\item Aa AA aa
+\item Bb BB bb
+\item Cc CC cc
+\item Oo OO oo
+\item Xx XX xx
+\item Yy YY yy
+\item Zz ZZ zz
+\item Åå ÅÅ åå
+\item Ää ÄÄ ää
+\item Öö ÖÖ öö
+\item Øø ØØ øø
+\item Αα ΑΑ αα
+\item Ββ ΒΒ ββ
+\item Γγ ΓΓ γγ
+\item Χχ ΧΧ χχ
+\item Ψψ ΨΨ ψψ
+\item Ωω ΩΩ ωω
+\item Аа АА аа
+\item Бб ББ бб
+\item Вв ВВ вв
+\item Ээ ЭЭ ээ
+\item Юю ЮЮ юю
+\item Яя ЯЯ яя
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/sortu-tr.bbl b/biblio/bibtex/bibtex-x/tests/sortu-tr.bbl
new file mode 100644
index 0000000000..3497df8725
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sortu-tr.bbl
@@ -0,0 +1,27 @@
+\section*{Test result}
+\begin{itemize}
+\item Aa AA aa
+\item Åå ÅÅ åå
+\item Ää ÄÄ ää
+\item Bb BB bb
+\item Cc CC cc
+\item Oo OO oo
+\item Øø ØØ øø
+\item Öö ÖÖ öö
+\item Xx XX xx
+\item Yy YY yy
+\item Zz ZZ zz
+\item Αα ΑΑ αα
+\item Ββ ΒΒ ββ
+\item Γγ ΓΓ γγ
+\item Χχ ΧΧ χχ
+\item Ψψ ΨΨ ψψ
+\item Ωω ΩΩ ωω
+\item Аа АА аа
+\item Бб ББ бб
+\item Вв ВВ вв
+\item Ээ ЭЭ ээ
+\item Юю ЮЮ юю
+\item Яя ЯЯ яя
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/sortu.aux b/biblio/bibtex/bibtex-x/tests/sortu.aux
new file mode 100644
index 0000000000..6d541f0253
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/sortu.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{teststyle}
+\bibdata{testsortu}
diff --git a/biblio/bibtex/bibtex-x/tests/substra.aux b/biblio/bibtex/bibtex-x/tests/substra.aux
new file mode 100644
index 0000000000..19ee643a1f
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/substra.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testsubstr}
+\bibdata{testsubstra}
diff --git a/biblio/bibtex/bibtex-x/tests/substra.bbl b/biblio/bibtex/bibtex-x/tests/substra.bbl
new file mode 100644
index 0000000000..9b182f7f23
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/substra.bbl
@@ -0,0 +1,334 @@
+\section*{Test result}
+\begin{itemize}
+\item[orig] ABCDEFG tuvwxyz
+\item[1 5] ABCDE
+\item[1 4] ABCD
+\item[1 3] ABC
+\item[1 2] AB
+\item[1 1] A
+\item[2 1] B
+\item[3 1] C
+\item[4 1] D
+\item[5 1] E
+\item[1 5] ABCDE
+\item[2 5] BCDEF
+\item[3 5] CDEFG
+\item[4 5] DEFG
+\item[5 5] EFG t
+\item[1 5] ABCDE
+\item[2 4] BCDE
+\item[3 3] CDE
+\item[4 2] DE
+\item[5 1] E
+\item[1 8] ABCDEFG
+\item[2 7] BCDEFG
+\item[3 6] CDEFG
+\item[4 5] DEFG
+\item[5 4] EFG
+\item[6 3] FG
+\item[7 2] G
+\item[8 1]
+\item[-1 5] vwxyz
+\item[-1 4] wxyz
+\item[-1 3] xyz
+\item[-1 2] yz
+\item[-1 1] z
+\item[-2 1] y
+\item[-3 1] x
+\item[-4 1] w
+\item[-5 1] v
+\item[-1 5] vwxyz
+\item[-2 5] uvwxy
+\item[-3 5] tuvwx
+\item[-4 5] tuvw
+\item[-5 5] G tuv
+\item[-1 5] vwxyz
+\item[-2 4] vwxy
+\item[-3 3] vwx
+\item[-4 2] vw
+\item[-5 1] v
+\item[-1 8] tuvwxyz
+\item[-2 7] tuvwxy
+\item[-3 6] tuvwx
+\item[-4 5] tuvw
+\item[-5 4] tuv
+\item[-6 3] tu
+\item[-7 2] t
+\item[-8 1]
+\item[orig] ~
+\item[1 5]
+\item[1 4]
+\item[1 3]
+\item[1 2]
+\item[1 1]
+\item[2 1]
+\item[3 1]
+\item[4 1]
+\item[5 1]
+\item[1 5]
+\item[2 5]
+\item[3 5]
+\item[4 5] ~
+\item[5 5] ~
+\item[1 5]
+\item[2 4]
+\item[3 3]
+\item[4 2]
+\item[5 1]
+\item[1 8] ~
+\item[2 7] ~
+\item[3 6] ~
+\item[4 5] ~
+\item[5 4] ~
+\item[6 3] ~
+\item[7 2] ~
+\item[8 1] ~
+\item[-1 5]
+\item[-1 4]
+\item[-1 3]
+\item[-1 2]
+\item[-1 1]
+\item[-2 1]
+\item[-3 1]
+\item[-4 1]
+\item[-5 1]
+\item[-1 5]
+\item[-2 5]
+\item[-3 5]
+\item[-4 5] ~
+\item[-5 5] ~
+\item[-1 5]
+\item[-2 4]
+\item[-3 3]
+\item[-4 2]
+\item[-5 1]
+\item[-1 8] ~
+\item[-2 7] ~
+\item[-3 6] ~
+\item[-4 5] ~
+\item[-5 4] ~
+\item[-6 3] ~
+\item[-7 2] ~
+\item[-8 1] ~
+\item[orig] {AB}CDEFG tuvwx{yz}
+\item[1 5] {AB}C
+\item[1 4] {AB}
+\item[1 3] {AB
+\item[1 2] {A
+\item[1 1] {
+\item[2 1] A
+\item[3 1] B
+\item[4 1] }
+\item[5 1] C
+\item[1 5] {AB}C
+\item[2 5] AB}CD
+\item[3 5] B}CDE
+\item[4 5] }CDEF
+\item[5 5] CDEFG
+\item[1 5] {AB}C
+\item[2 4] AB}C
+\item[3 3] B}C
+\item[4 2] }C
+\item[5 1] C
+\item[1 8] {AB}CDEF
+\item[2 7] AB}CDEF
+\item[3 6] B}CDEF
+\item[4 5] }CDEF
+\item[5 4] CDEF
+\item[6 3] DEF
+\item[7 2] EF
+\item[8 1] F
+\item[-1 5] x{yz}
+\item[-1 4] {yz}
+\item[-1 3] yz}
+\item[-1 2] z}
+\item[-1 1] }
+\item[-2 1] z
+\item[-3 1] y
+\item[-4 1] {
+\item[-5 1] x
+\item[-1 5] x{yz}
+\item[-2 5] wx{yz
+\item[-3 5] vwx{y
+\item[-4 5] uvwx{
+\item[-5 5] tuvwx
+\item[-1 5] x{yz}
+\item[-2 4] x{yz
+\item[-3 3] x{y
+\item[-4 2] x{
+\item[-5 1] x
+\item[-1 8] uvwx{yz}
+\item[-2 7] uvwx{yz
+\item[-3 6] uvwx{y
+\item[-4 5] uvwx{
+\item[-5 4] uvwx
+\item[-6 3] uvw
+\item[-7 2] uv
+\item[-8 1] u
+\item[orig] {{AB}CD}EFG tuv{wx{yz}}
+\item[1 5] {{AB}
+\item[1 4] {{AB
+\item[1 3] {{A
+\item[1 2] {{
+\item[1 1] {
+\item[2 1] {
+\item[3 1] A
+\item[4 1] B
+\item[5 1] }
+\item[1 5] {{AB}
+\item[2 5] {AB}C
+\item[3 5] AB}CD
+\item[4 5] B}CD}
+\item[5 5] }CD}E
+\item[1 5] {{AB}
+\item[2 4] {AB}
+\item[3 3] AB}
+\item[4 2] B}
+\item[5 1] }
+\item[1 8] {{AB}CD}
+\item[2 7] {AB}CD}
+\item[3 6] AB}CD}
+\item[4 5] B}CD}
+\item[5 4] }CD}
+\item[6 3] CD}
+\item[7 2] D}
+\item[8 1] }
+\item[-1 5] {yz}}
+\item[-1 4] yz}}
+\item[-1 3] z}}
+\item[-1 2] }}
+\item[-1 1] }
+\item[-2 1] }
+\item[-3 1] z
+\item[-4 1] y
+\item[-5 1] {
+\item[-1 5] {yz}}
+\item[-2 5] x{yz}
+\item[-3 5] wx{yz
+\item[-4 5] {wx{y
+\item[-5 5] v{wx{
+\item[-1 5] {yz}}
+\item[-2 4] {yz}
+\item[-3 3] {yz
+\item[-4 2] {y
+\item[-5 1] {
+\item[-1 8] {wx{yz}}
+\item[-2 7] {wx{yz}
+\item[-3 6] {wx{yz
+\item[-4 5] {wx{y
+\item[-5 4] {wx{
+\item[-6 3] {wx
+\item[-7 2] {w
+\item[-8 1] {
+\item[orig] {{}}~{{}}
+\item[1 5] {{}
+\item[1 4] {{
+\item[1 3] {{
+\item[1 2] {{
+\item[1 1] {
+\item[2 1] {
+\item[3 1]
+\item[4 1]
+\item[5 1] }
+\item[1 5] {{}
+\item[2 5] {}
+\item[3 5] }
+\item[4 5] }}
+\item[5 5] }}
+\item[1 5] {{}
+\item[2 4] {}
+\item[3 3] }
+\item[4 2] }
+\item[5 1] }
+\item[1 8] {{}}
+\item[2 7] {}}
+\item[3 6] }}
+\item[4 5] }}
+\item[5 4] }}
+\item[6 3] }
+\item[7 2] }
+\item[8 1] }
+\item[-1 5] {}}
+\item[-1 4] }}
+\item[-1 3] }}
+\item[-1 2] }}
+\item[-1 1] }
+\item[-2 1] }
+\item[-3 1]
+\item[-4 1]
+\item[-5 1] {
+\item[-1 5] {}}
+\item[-2 5] {}
+\item[-3 5] {
+\item[-4 5] {{
+\item[-5 5] {{
+\item[-1 5] {}}
+\item[-2 4] {}
+\item[-3 3] {
+\item[-4 2] {
+\item[-5 1] {
+\item[-1 8] {{}}
+\item[-2 7] {{}
+\item[-3 6] {{
+\item[-4 5] {{
+\item[-5 4] {{
+\item[-6 3] {
+\item[-7 2] {
+\item[-8 1] {
+\item[orig] {\a}{\b}{\c}
+\item[1 5] {\a}
+\item[1 4] {\a}
+\item[1 3] {\a
+\item[1 2] {\
+\item[1 1] {
+\item[2 1] \
+\item[3 1] a
+\item[4 1] }
+\item[5 1]
+\item[1 5] {\a}
+\item[2 5] \a}
+\item[3 5] a}{
+\item[4 5] }{\
+\item[5 5] {\b
+\item[1 5] {\a}
+\item[2 4] \a}
+\item[3 3] a}
+\item[4 2] }
+\item[5 1]
+\item[1 8] {\a}{\
+\item[2 7] \a}{\
+\item[3 6] a}{\
+\item[4 5] }{\
+\item[5 4] {\
+\item[6 3] {\
+\item[7 2] {\
+\item[8 1] \
+\item[-1 5] \c}
+\item[-1 4] c}
+\item[-1 3] }
+\item[-1 2]
+\item[-1 1]
+\item[-2 1]
+\item[-3 1] }
+\item[-4 1] c
+\item[-5 1] \
+\item[-1 5] \c}
+\item[-2 5] {\c}
+\item[-3 5] {\c}
+\item[-4 5] {\c
+\item[-5 5] }{\
+\item[-1 5] \c}
+\item[-2 4] \c}
+\item[-3 3] \c}
+\item[-4 2] \c
+\item[-5 1] \
+\item[-1 8] {\c}
+\item[-2 7] {\c}
+\item[-3 6] {\c}
+\item[-4 5] {\c
+\item[-5 4] {\
+\item[-6 3] {
+\item[-7 2]
+\item[-8 1]
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/substru.aux b/biblio/bibtex/bibtex-x/tests/substru.aux
new file mode 100644
index 0000000000..79098b209d
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/substru.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testsubstr}
+\bibdata{testsubstru}
diff --git a/biblio/bibtex/bibtex-x/tests/substru.bbl b/biblio/bibtex/bibtex-x/tests/substru.bbl
new file mode 100644
index 0000000000..48e2601b8e
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/substru.bbl
@@ -0,0 +1,885 @@
+\section*{Test result}
+\begin{itemize}
+\item[orig] ABCDEFG tuvwxyz
+\item[1 5] ABCDE
+\item[1 4] ABCD
+\item[1 3] ABC
+\item[1 2] AB
+\item[1 1] A
+\item[2 1] B
+\item[3 1] C
+\item[4 1] D
+\item[5 1] E
+\item[1 5] ABCDE
+\item[2 5] BCDEF
+\item[3 5] CDEFG
+\item[4 5] DEFG
+\item[5 5] EFG t
+\item[1 5] ABCDE
+\item[2 4] BCDE
+\item[3 3] CDE
+\item[4 2] DE
+\item[5 1] E
+\item[1 8] ABCDEFG
+\item[2 7] BCDEFG
+\item[3 6] CDEFG
+\item[4 5] DEFG
+\item[5 4] EFG
+\item[6 3] FG
+\item[7 2] G
+\item[8 1]
+\item[-1 5] vwxyz
+\item[-1 4] wxyz
+\item[-1 3] xyz
+\item[-1 2] yz
+\item[-1 1] z
+\item[-2 1] y
+\item[-3 1] x
+\item[-4 1] w
+\item[-5 1] v
+\item[-1 5] vwxyz
+\item[-2 5] uvwxy
+\item[-3 5] tuvwx
+\item[-4 5] tuvw
+\item[-5 5] G tuv
+\item[-1 5] vwxyz
+\item[-2 4] vwxy
+\item[-3 3] vwx
+\item[-4 2] vw
+\item[-5 1] v
+\item[-1 8] tuvwxyz
+\item[-2 7] tuvwxy
+\item[-3 6] tuvwx
+\item[-4 5] tuvw
+\item[-5 4] tuv
+\item[-6 3] tu
+\item[-7 2] t
+\item[-8 1]
+\item[orig] ÅÇÈÎØÜÝ~åçèîøüý
+\item[1 5] ÅÇÈÎØ
+\item[1 4] ÅÇÈÎ
+\item[1 3] ÅÇÈ
+\item[1 2] ÅÇ
+\item[1 1] Å
+\item[2 1] Ç
+\item[3 1] È
+\item[4 1] Î
+\item[5 1] Ø
+\item[1 5] ÅÇÈÎØ
+\item[2 5] ÇÈÎØÜ
+\item[3 5] ÈÎØÜÝ
+\item[4 5] ÎØÜÝ~
+\item[5 5] ØÜÝ~å
+\item[1 5] ÅÇÈÎØ
+\item[2 4] ÇÈÎØ
+\item[3 3] ÈÎØ
+\item[4 2] ÎØ
+\item[5 1] Ø
+\item[1 8] ÅÇÈÎØÜÝ~
+\item[2 7] ÇÈÎØÜÝ~
+\item[3 6] ÈÎØÜÝ~
+\item[4 5] ÎØÜÝ~
+\item[5 4] ØÜÝ~
+\item[6 3] ÜÝ~
+\item[7 2] Ý~
+\item[8 1] ~
+\item[-1 5] èîøüý
+\item[-1 4] îøüý
+\item[-1 3] øüý
+\item[-1 2] üý
+\item[-1 1] ý
+\item[-2 1] ü
+\item[-3 1] ø
+\item[-4 1] î
+\item[-5 1] è
+\item[-1 5] èîøüý
+\item[-2 5] çèîøü
+\item[-3 5] åçèîø
+\item[-4 5] ~åçèî
+\item[-5 5] Ý~åçè
+\item[-1 5] èîøüý
+\item[-2 4] èîøü
+\item[-3 3] èîø
+\item[-4 2] èî
+\item[-5 1] è
+\item[-1 8] ~åçèîøüý
+\item[-2 7] ~åçèîøü
+\item[-3 6] ~åçèîø
+\item[-4 5] ~åçèî
+\item[-5 4] ~åçè
+\item[-6 3] ~åç
+\item[-7 2] ~å
+\item[-8 1] ~
+\item[orig] AÇう冤EÜЖ~tçユ漆𡚴xюω
+\item[1 5] AÇう冤E
+\item[1 4] AÇう冤
+\item[1 3] AÇう
+\item[1 2] AÇ
+\item[1 1] A
+\item[2 1] Ç
+\item[3 1] う
+\item[4 1] 冤
+\item[5 1] E
+\item[1 5] AÇう冤E
+\item[2 5] Çう冤EÜ
+\item[3 5] う冤EÜЖ
+\item[4 5] 冤EÜЖ~
+\item[5 5] EÜЖ~t
+\item[1 5] AÇう冤E
+\item[2 4] Çう冤E
+\item[3 3] う冤E
+\item[4 2] 冤E
+\item[5 1] E
+\item[1 8] AÇう冤EÜЖ~
+\item[2 7] Çう冤EÜЖ~
+\item[3 6] う冤EÜЖ~
+\item[4 5] 冤EÜЖ~
+\item[5 4] EÜЖ~
+\item[6 3] ÜЖ~
+\item[7 2] Ж~
+\item[8 1] ~
+\item[-1 5] 漆𡚴xюω
+\item[-1 4] 𡚴xюω
+\item[-1 3] xюω
+\item[-1 2] юω
+\item[-1 1] ω
+\item[-2 1] ю
+\item[-3 1] x
+\item[-4 1] 𡚴
+\item[-5 1] 漆
+\item[-1 5] 漆𡚴xюω
+\item[-2 5] ユ漆𡚴xю
+\item[-3 5] çユ漆𡚴x
+\item[-4 5] tçユ漆𡚴
+\item[-5 5] ~tçユ漆
+\item[-1 5] 漆𡚴xюω
+\item[-2 4] 漆𡚴xю
+\item[-3 3] 漆𡚴x
+\item[-4 2] 漆𡚴
+\item[-5 1] 漆
+\item[-1 8] tçユ漆𡚴xюω
+\item[-2 7] tçユ漆𡚴xю
+\item[-3 6] tçユ漆𡚴x
+\item[-4 5] tçユ漆𡚴
+\item[-5 4] tçユ漆
+\item[-6 3] tçユ
+\item[-7 2] tç
+\item[-8 1] t
+\item[orig] {AB}CDEFG tuvwx{yz}
+\item[1 5] {AB}C
+\item[1 4] {AB}
+\item[1 3] {AB
+\item[1 2] {A
+\item[1 1] {
+\item[2 1] A
+\item[3 1] B
+\item[4 1] }
+\item[5 1] C
+\item[1 5] {AB}C
+\item[2 5] AB}CD
+\item[3 5] B}CDE
+\item[4 5] }CDEF
+\item[5 5] CDEFG
+\item[1 5] {AB}C
+\item[2 4] AB}C
+\item[3 3] B}C
+\item[4 2] }C
+\item[5 1] C
+\item[1 8] {AB}CDEF
+\item[2 7] AB}CDEF
+\item[3 6] B}CDEF
+\item[4 5] }CDEF
+\item[5 4] CDEF
+\item[6 3] DEF
+\item[7 2] EF
+\item[8 1] F
+\item[-1 5] x{yz}
+\item[-1 4] {yz}
+\item[-1 3] yz}
+\item[-1 2] z}
+\item[-1 1] }
+\item[-2 1] z
+\item[-3 1] y
+\item[-4 1] {
+\item[-5 1] x
+\item[-1 5] x{yz}
+\item[-2 5] wx{yz
+\item[-3 5] vwx{y
+\item[-4 5] uvwx{
+\item[-5 5] tuvwx
+\item[-1 5] x{yz}
+\item[-2 4] x{yz
+\item[-3 3] x{y
+\item[-4 2] x{
+\item[-5 1] x
+\item[-1 8] uvwx{yz}
+\item[-2 7] uvwx{yz
+\item[-3 6] uvwx{y
+\item[-4 5] uvwx{
+\item[-5 4] uvwx
+\item[-6 3] uvw
+\item[-7 2] uv
+\item[-8 1] u
+\item[orig] {\a}Åå{\b}Ææ{\c}Çç
+\item[1 5] {\a}Å
+\item[1 4] {\a}
+\item[1 3] {\a
+\item[1 2] {\
+\item[1 1] {
+\item[2 1] \
+\item[3 1] a
+\item[4 1] }
+\item[5 1] Å
+\item[1 5] {\a}Å
+\item[2 5] \a}Åå
+\item[3 5] a}Åå{
+\item[4 5] }Åå{\
+\item[5 5] Åå{\b
+\item[1 5] {\a}Å
+\item[2 4] \a}Å
+\item[3 3] a}Å
+\item[4 2] }Å
+\item[5 1] Å
+\item[1 8] {\a}Åå{\
+\item[2 7] \a}Åå{\
+\item[3 6] a}Åå{\
+\item[4 5] }Åå{\
+\item[5 4] Åå{\
+\item[6 3] å{\
+\item[7 2] {\
+\item[8 1] \
+\item[-1 5] \c}Çç
+\item[-1 4] c}Çç
+\item[-1 3] }Çç
+\item[-1 2] Çç
+\item[-1 1] ç
+\item[-2 1] Ç
+\item[-3 1] }
+\item[-4 1] c
+\item[-5 1] \
+\item[-1 5] \c}Çç
+\item[-2 5] {\c}Ç
+\item[-3 5] æ{\c}
+\item[-4 5] Ææ{\c
+\item[-5 5] }Ææ{\
+\item[-1 5] \c}Çç
+\item[-2 4] \c}Ç
+\item[-3 3] \c}
+\item[-4 2] \c
+\item[-5 1] \
+\item[-1 8] Ææ{\c}Çç
+\item[-2 7] Ææ{\c}Ç
+\item[-3 6] Ææ{\c}
+\item[-4 5] Ææ{\c
+\item[-5 4] Ææ{\
+\item[-6 3] Ææ{
+\item[-7 2] Ææ
+\item[-8 1] Æ
+\item[orig] {\a}αあ{\b}βい{\c}γう
+\item[1 5] {\a}α
+\item[1 4] {\a}
+\item[1 3] {\a
+\item[1 2] {\
+\item[1 1] {
+\item[2 1] \
+\item[3 1] a
+\item[4 1] }
+\item[5 1] α
+\item[1 5] {\a}α
+\item[2 5] \a}αあ
+\item[3 5] a}αあ{
+\item[4 5] }αあ{\
+\item[5 5] αあ{\b
+\item[1 5] {\a}α
+\item[2 4] \a}α
+\item[3 3] a}α
+\item[4 2] }α
+\item[5 1] α
+\item[1 8] {\a}αあ{\
+\item[2 7] \a}αあ{\
+\item[3 6] a}αあ{\
+\item[4 5] }αあ{\
+\item[5 4] αあ{\
+\item[6 3] あ{\
+\item[7 2] {\
+\item[8 1] \
+\item[-1 5] \c}γう
+\item[-1 4] c}γう
+\item[-1 3] }γう
+\item[-1 2] γう
+\item[-1 1] う
+\item[-2 1] γ
+\item[-3 1] }
+\item[-4 1] c
+\item[-5 1] \
+\item[-1 5] \c}γう
+\item[-2 5] {\c}γ
+\item[-3 5] い{\c}
+\item[-4 5] βい{\c
+\item[-5 5] }βい{\
+\item[-1 5] \c}γう
+\item[-2 4] \c}γ
+\item[-3 3] \c}
+\item[-4 2] \c
+\item[-5 1] \
+\item[-1 8] βい{\c}γう
+\item[-2 7] βい{\c}γ
+\item[-3 6] βい{\c}
+\item[-4 5] βい{\c
+\item[-5 4] βい{\
+\item[-6 3] βい{
+\item[-7 2] βい
+\item[-8 1] β
+\item[orig] {\a}あα{\b}いβ{\c}うγ
+\item[1 5] {\a}あ
+\item[1 4] {\a}
+\item[1 3] {\a
+\item[1 2] {\
+\item[1 1] {
+\item[2 1] \
+\item[3 1] a
+\item[4 1] }
+\item[5 1] あ
+\item[1 5] {\a}あ
+\item[2 5] \a}あα
+\item[3 5] a}あα{
+\item[4 5] }あα{\
+\item[5 5] あα{\b
+\item[1 5] {\a}あ
+\item[2 4] \a}あ
+\item[3 3] a}あ
+\item[4 2] }あ
+\item[5 1] あ
+\item[1 8] {\a}あα{\
+\item[2 7] \a}あα{\
+\item[3 6] a}あα{\
+\item[4 5] }あα{\
+\item[5 4] あα{\
+\item[6 3] α{\
+\item[7 2] {\
+\item[8 1] \
+\item[-1 5] \c}うγ
+\item[-1 4] c}うγ
+\item[-1 3] }うγ
+\item[-1 2] うγ
+\item[-1 1] γ
+\item[-2 1] う
+\item[-3 1] }
+\item[-4 1] c
+\item[-5 1] \
+\item[-1 5] \c}うγ
+\item[-2 5] {\c}う
+\item[-3 5] β{\c}
+\item[-4 5] いβ{\c
+\item[-5 5] }いβ{\
+\item[-1 5] \c}うγ
+\item[-2 4] \c}う
+\item[-3 3] \c}
+\item[-4 2] \c
+\item[-5 1] \
+\item[-1 8] いβ{\c}うγ
+\item[-2 7] いβ{\c}う
+\item[-3 6] いβ{\c}
+\item[-4 5] いβ{\c
+\item[-5 4] いβ{\
+\item[-6 3] いβ{
+\item[-7 2] いβ
+\item[-8 1] い
+\item[orig] {{AB}CD}EFG tuv{wx{yz}}
+\item[1 5] {{AB}
+\item[1 4] {{AB
+\item[1 3] {{A
+\item[1 2] {{
+\item[1 1] {
+\item[2 1] {
+\item[3 1] A
+\item[4 1] B
+\item[5 1] }
+\item[1 5] {{AB}
+\item[2 5] {AB}C
+\item[3 5] AB}CD
+\item[4 5] B}CD}
+\item[5 5] }CD}E
+\item[1 5] {{AB}
+\item[2 4] {AB}
+\item[3 3] AB}
+\item[4 2] B}
+\item[5 1] }
+\item[1 8] {{AB}CD}
+\item[2 7] {AB}CD}
+\item[3 6] AB}CD}
+\item[4 5] B}CD}
+\item[5 4] }CD}
+\item[6 3] CD}
+\item[7 2] D}
+\item[8 1] }
+\item[-1 5] {yz}}
+\item[-1 4] yz}}
+\item[-1 3] z}}
+\item[-1 2] }}
+\item[-1 1] }
+\item[-2 1] }
+\item[-3 1] z
+\item[-4 1] y
+\item[-5 1] {
+\item[-1 5] {yz}}
+\item[-2 5] x{yz}
+\item[-3 5] wx{yz
+\item[-4 5] {wx{y
+\item[-5 5] v{wx{
+\item[-1 5] {yz}}
+\item[-2 4] {yz}
+\item[-3 3] {yz
+\item[-4 2] {y
+\item[-5 1] {
+\item[-1 8] {wx{yz}}
+\item[-2 7] {wx{yz}
+\item[-3 6] {wx{yz
+\item[-4 5] {wx{y
+\item[-5 4] {wx{
+\item[-6 3] {wx
+\item[-7 2] {w
+\item[-8 1] {
+\item[orig] {{ÅÇ}ÈÎ}ØÜÝ~åçè{îø{üý}}
+\item[1 5] {{ÅÇ}
+\item[1 4] {{ÅÇ
+\item[1 3] {{Å
+\item[1 2] {{
+\item[1 1] {
+\item[2 1] {
+\item[3 1] Å
+\item[4 1] Ç
+\item[5 1] }
+\item[1 5] {{ÅÇ}
+\item[2 5] {ÅÇ}È
+\item[3 5] ÅÇ}ÈÎ
+\item[4 5] Ç}ÈÎ}
+\item[5 5] }ÈÎ}Ø
+\item[1 5] {{ÅÇ}
+\item[2 4] {ÅÇ}
+\item[3 3] ÅÇ}
+\item[4 2] Ç}
+\item[5 1] }
+\item[1 8] {{ÅÇ}ÈÎ}
+\item[2 7] {ÅÇ}ÈÎ}
+\item[3 6] ÅÇ}ÈÎ}
+\item[4 5] Ç}ÈÎ}
+\item[5 4] }ÈÎ}
+\item[6 3] ÈÎ}
+\item[7 2] Î}
+\item[8 1] }
+\item[-1 5] {üý}}
+\item[-1 4] üý}}
+\item[-1 3] ý}}
+\item[-1 2] }}
+\item[-1 1] }
+\item[-2 1] }
+\item[-3 1] ý
+\item[-4 1] ü
+\item[-5 1] {
+\item[-1 5] {üý}}
+\item[-2 5] ø{üý}
+\item[-3 5] îø{üý
+\item[-4 5] {îø{ü
+\item[-5 5] è{îø{
+\item[-1 5] {üý}}
+\item[-2 4] {üý}
+\item[-3 3] {üý
+\item[-4 2] {ü
+\item[-5 1] {
+\item[-1 8] {îø{üý}}
+\item[-2 7] {îø{üý}
+\item[-3 6] {îø{üý
+\item[-4 5] {îø{ü
+\item[-5 4] {îø{
+\item[-6 3] {îø
+\item[-7 2] {î
+\item[-8 1] {
+\item[orig] {{一二}三四}五六七 肆伍陸{漆捌{玖拾}}
+\item[1 5] {{一二}
+\item[1 4] {{一二
+\item[1 3] {{一
+\item[1 2] {{
+\item[1 1] {
+\item[2 1] {
+\item[3 1] 一
+\item[4 1] 二
+\item[5 1] }
+\item[1 5] {{一二}
+\item[2 5] {一二}三
+\item[3 5] 一二}三四
+\item[4 5] 二}三四}
+\item[5 5] }三四}五
+\item[1 5] {{一二}
+\item[2 4] {一二}
+\item[3 3] 一二}
+\item[4 2] 二}
+\item[5 1] }
+\item[1 8] {{一二}三四}
+\item[2 7] {一二}三四}
+\item[3 6] 一二}三四}
+\item[4 5] 二}三四}
+\item[5 4] }三四}
+\item[6 3] 三四}
+\item[7 2] 四}
+\item[8 1] }
+\item[-1 5] {玖拾}}
+\item[-1 4] 玖拾}}
+\item[-1 3] 拾}}
+\item[-1 2] }}
+\item[-1 1] }
+\item[-2 1] }
+\item[-3 1] 拾
+\item[-4 1] 玖
+\item[-5 1] {
+\item[-1 5] {玖拾}}
+\item[-2 5] 捌{玖拾}
+\item[-3 5] 漆捌{玖拾
+\item[-4 5] {漆捌{玖
+\item[-5 5] 陸{漆捌{
+\item[-1 5] {玖拾}}
+\item[-2 4] {玖拾}
+\item[-3 3] {玖拾
+\item[-4 2] {玖
+\item[-5 1] {
+\item[-1 8] {漆捌{玖拾}}
+\item[-2 7] {漆捌{玖拾}
+\item[-3 6] {漆捌{玖拾
+\item[-4 5] {漆捌{玖
+\item[-5 4] {漆捌{
+\item[-6 3] {漆捌
+\item[-7 2] {漆
+\item[-8 1] {
+\item[orig]
+ {{櫛杓}屠冤}𦥑𠮟𠀋𡈽𥝱𨦇𡚴{𠷡𧘕{𧘔𩸽}}
+\item[1 5] {{櫛杓}
+\item[1 4] {{櫛杓
+\item[1 3] {{櫛
+\item[1 2] {{
+\item[1 1] {
+\item[2 1] {
+\item[3 1] 櫛
+\item[4 1] 杓
+\item[5 1] }
+\item[1 5] {{櫛杓}
+\item[2 5] {櫛杓}屠
+\item[3 5] 櫛杓}屠冤
+\item[4 5] 杓}屠冤}
+\item[5 5] }屠冤}𦥑
+\item[1 5] {{櫛杓}
+\item[2 4] {櫛杓}
+\item[3 3] 櫛杓}
+\item[4 2] 杓}
+\item[5 1] }
+\item[1 8] {{櫛杓}屠冤}
+\item[2 7] {櫛杓}屠冤}
+\item[3 6] 櫛杓}屠冤}
+\item[4 5] 杓}屠冤}
+\item[5 4] }屠冤}
+\item[6 3] 屠冤}
+\item[7 2] 冤}
+\item[8 1] }
+\item[-1 5] {𧘔𩸽}}
+\item[-1 4] 𧘔𩸽}}
+\item[-1 3] 𩸽}}
+\item[-1 2] }}
+\item[-1 1] }
+\item[-2 1] }
+\item[-3 1] 𩸽
+\item[-4 1] 𧘔
+\item[-5 1] {
+\item[-1 5] {𧘔𩸽}}
+\item[-2 5] 𧘕{𧘔𩸽}
+\item[-3 5] 𠷡𧘕{𧘔𩸽
+\item[-4 5] {𠷡𧘕{𧘔
+\item[-5 5] 𡚴{𠷡𧘕{
+\item[-1 5] {𧘔𩸽}}
+\item[-2 4] {𧘔𩸽}
+\item[-3 3] {𧘔𩸽
+\item[-4 2] {𧘔
+\item[-5 1] {
+\item[-1 8] {𠷡𧘕{𧘔𩸽}}
+\item[-2 7] {𠷡𧘕{𧘔𩸽}
+\item[-3 6] {𠷡𧘕{𧘔𩸽
+\item[-4 5] {𠷡𧘕{𧘔
+\item[-5 4] {𠷡𧘕{
+\item[-6 3] {𠷡𧘕
+\item[-7 2] {𠷡
+\item[-8 1] {
+\item[orig] ΑΒΓΔΕΖΗ στυφχψω
+\item[1 5] ΑΒΓΔΕ
+\item[1 4] ΑΒΓΔ
+\item[1 3] ΑΒΓ
+\item[1 2] ΑΒ
+\item[1 1] Α
+\item[2 1] Β
+\item[3 1] Γ
+\item[4 1] Δ
+\item[5 1] Ε
+\item[1 5] ΑΒΓΔΕ
+\item[2 5] ΒΓΔΕΖ
+\item[3 5] ΓΔΕΖΗ
+\item[4 5] ΔΕΖΗ
+\item[5 5] ΕΖΗ σ
+\item[1 5] ΑΒΓΔΕ
+\item[2 4] ΒΓΔΕ
+\item[3 3] ΓΔΕ
+\item[4 2] ΔΕ
+\item[5 1] Ε
+\item[1 8] ΑΒΓΔΕΖΗ
+\item[2 7] ΒΓΔΕΖΗ
+\item[3 6] ΓΔΕΖΗ
+\item[4 5] ΔΕΖΗ
+\item[5 4] ΕΖΗ
+\item[6 3] ΖΗ
+\item[7 2] Η
+\item[8 1]
+\item[-1 5] υφχψω
+\item[-1 4] φχψω
+\item[-1 3] χψω
+\item[-1 2] ψω
+\item[-1 1] ω
+\item[-2 1] ψ
+\item[-3 1] χ
+\item[-4 1] φ
+\item[-5 1] υ
+\item[-1 5] υφχψω
+\item[-2 5] τυφχψ
+\item[-3 5] στυφχ
+\item[-4 5] στυφ
+\item[-5 5] Η στυ
+\item[-1 5] υφχψω
+\item[-2 4] υφχψ
+\item[-3 3] υφχ
+\item[-4 2] υφ
+\item[-5 1] υ
+\item[-1 8] στυφχψω
+\item[-2 7] στυφχψ
+\item[-3 6] στυφχ
+\item[-4 5] στυφ
+\item[-5 4] στυ
+\item[-6 3] στ
+\item[-7 2] σ
+\item[-8 1]
+\item[orig] АБВГДЕЖ щъыьэюя
+\item[1 5] АБВГД
+\item[1 4] АБВГ
+\item[1 3] АБВ
+\item[1 2] АБ
+\item[1 1] А
+\item[2 1] Б
+\item[3 1] В
+\item[4 1] Г
+\item[5 1] Д
+\item[1 5] АБВГД
+\item[2 5] БВГДЕ
+\item[3 5] ВГДЕЖ
+\item[4 5] ГДЕЖ
+\item[5 5] ДЕЖ щ
+\item[1 5] АБВГД
+\item[2 4] БВГД
+\item[3 3] ВГД
+\item[4 2] ГД
+\item[5 1] Д
+\item[1 8] АБВГДЕЖ
+\item[2 7] БВГДЕЖ
+\item[3 6] ВГДЕЖ
+\item[4 5] ГДЕЖ
+\item[5 4] ДЕЖ
+\item[6 3] ЕЖ
+\item[7 2] Ж
+\item[8 1]
+\item[-1 5] ыьэюя
+\item[-1 4] ьэюя
+\item[-1 3] эюя
+\item[-1 2] юя
+\item[-1 1] я
+\item[-2 1] ю
+\item[-3 1] э
+\item[-4 1] ь
+\item[-5 1] ы
+\item[-1 5] ыьэюя
+\item[-2 5] ъыьэю
+\item[-3 5] щъыьэ
+\item[-4 5] щъыь
+\item[-5 5] Ж щъы
+\item[-1 5] ыьэюя
+\item[-2 4] ыьэю
+\item[-3 3] ыьэ
+\item[-4 2] ыь
+\item[-5 1] ы
+\item[-1 8] щъыьэюя
+\item[-2 7] щъыьэю
+\item[-3 6] щъыьэ
+\item[-4 5] щъыь
+\item[-5 4] щъы
+\item[-6 3] щъ
+\item[-7 2] щ
+\item[-8 1]
+\item[orig] あいうえおかき ユヨワヰヱヲン
+\item[1 5] あいうえお
+\item[1 4] あいうえ
+\item[1 3] あいう
+\item[1 2] あい
+\item[1 1] あ
+\item[2 1] い
+\item[3 1] う
+\item[4 1] え
+\item[5 1] お
+\item[1 5] あいうえお
+\item[2 5] いうえおか
+\item[3 5] うえおかき
+\item[4 5] えおかき 
+\item[5 5] おかき ユ
+\item[1 5] あいうえお
+\item[2 4] いうえお
+\item[3 3] うえお
+\item[4 2] えお
+\item[5 1] お
+\item[1 8] あいうえおかき 
+\item[2 7] いうえおかき 
+\item[3 6] うえおかき 
+\item[4 5] えおかき 
+\item[5 4] おかき 
+\item[6 3] かき 
+\item[7 2] き 
+\item[8 1]  
+\item[-1 5] ワヰヱヲン
+\item[-1 4] ヰヱヲン
+\item[-1 3] ヱヲン
+\item[-1 2] ヲン
+\item[-1 1] ン
+\item[-2 1] ヲ
+\item[-3 1] ヱ
+\item[-4 1] ヰ
+\item[-5 1] ワ
+\item[-1 5] ワヰヱヲン
+\item[-2 5] ヨワヰヱヲ
+\item[-3 5] ユヨワヰヱ
+\item[-4 5]  ユヨワヰ
+\item[-5 5] き ユヨワ
+\item[-1 5] ワヰヱヲン
+\item[-2 4] ワヰヱヲ
+\item[-3 3] ワヰヱ
+\item[-4 2] ワヰ
+\item[-5 1] ワ
+\item[-1 8]  ユヨワヰヱヲン
+\item[-2 7]  ユヨワヰヱヲ
+\item[-3 6]  ユヨワヰヱ
+\item[-4 5]  ユヨワヰ
+\item[-5 4]  ユヨワ
+\item[-6 3]  ユヨ
+\item[-7 2]  ユ
+\item[-8 1]  
+\item[orig] 一二三四五六七 肆伍陸漆捌玖拾
+\item[1 5] 一二三四五
+\item[1 4] 一二三四
+\item[1 3] 一二三
+\item[1 2] 一二
+\item[1 1] 一
+\item[2 1] 二
+\item[3 1] 三
+\item[4 1] 四
+\item[5 1] 五
+\item[1 5] 一二三四五
+\item[2 5] 二三四五六
+\item[3 5] 三四五六七
+\item[4 5] 四五六七 
+\item[5 5] 五六七 肆
+\item[1 5] 一二三四五
+\item[2 4] 二三四五
+\item[3 3] 三四五
+\item[4 2] 四五
+\item[5 1] 五
+\item[1 8] 一二三四五六七 
+\item[2 7] 二三四五六七 
+\item[3 6] 三四五六七 
+\item[4 5] 四五六七 
+\item[5 4] 五六七 
+\item[6 3] 六七 
+\item[7 2] 七 
+\item[8 1]  
+\item[-1 5] 陸漆捌玖拾
+\item[-1 4] 漆捌玖拾
+\item[-1 3] 捌玖拾
+\item[-1 2] 玖拾
+\item[-1 1] 拾
+\item[-2 1] 玖
+\item[-3 1] 捌
+\item[-4 1] 漆
+\item[-5 1] 陸
+\item[-1 5] 陸漆捌玖拾
+\item[-2 5] 伍陸漆捌玖
+\item[-3 5] 肆伍陸漆捌
+\item[-4 5]  肆伍陸漆
+\item[-5 5] 七 肆伍陸
+\item[-1 5] 陸漆捌玖拾
+\item[-2 4] 陸漆捌玖
+\item[-3 3] 陸漆捌
+\item[-4 2] 陸漆
+\item[-5 1] 陸
+\item[-1 8]  肆伍陸漆捌玖拾
+\item[-2 7]  肆伍陸漆捌玖
+\item[-3 6]  肆伍陸漆捌
+\item[-4 5]  肆伍陸漆
+\item[-5 4]  肆伍陸
+\item[-6 3]  肆伍
+\item[-7 2]  肆
+\item[-8 1]  
+\item[orig] 櫛杓屠冤𦥑𠮟𠀋𡈽𥝱𨦇𡚴𠷡𧘕𧘔𩸽
+\item[1 5] 櫛杓屠冤𦥑
+\item[1 4] 櫛杓屠冤
+\item[1 3] 櫛杓屠
+\item[1 2] 櫛杓
+\item[1 1] 櫛
+\item[2 1] 杓
+\item[3 1] 屠
+\item[4 1] 冤
+\item[5 1] 𦥑
+\item[1 5] 櫛杓屠冤𦥑
+\item[2 5] 杓屠冤𦥑𠮟
+\item[3 5] 屠冤𦥑𠮟𠀋
+\item[4 5] 冤𦥑𠮟𠀋𡈽
+\item[5 5] 𦥑𠮟𠀋𡈽𥝱
+\item[1 5] 櫛杓屠冤𦥑
+\item[2 4] 杓屠冤𦥑
+\item[3 3] 屠冤𦥑
+\item[4 2] 冤𦥑
+\item[5 1] 𦥑
+\item[1 8] 櫛杓屠冤𦥑𠮟𠀋𡈽
+\item[2 7] 杓屠冤𦥑𠮟𠀋𡈽
+\item[3 6] 屠冤𦥑𠮟𠀋𡈽
+\item[4 5] 冤𦥑𠮟𠀋𡈽
+\item[5 4] 𦥑𠮟𠀋𡈽
+\item[6 3] 𠮟𠀋𡈽
+\item[7 2] 𠀋𡈽
+\item[8 1] 𡈽
+\item[-1 5] 𡚴𠷡𧘕𧘔𩸽
+\item[-1 4] 𠷡𧘕𧘔𩸽
+\item[-1 3] 𧘕𧘔𩸽
+\item[-1 2] 𧘔𩸽
+\item[-1 1] 𩸽
+\item[-2 1] 𧘔
+\item[-3 1] 𧘕
+\item[-4 1] 𠷡
+\item[-5 1] 𡚴
+\item[-1 5] 𡚴𠷡𧘕𧘔𩸽
+\item[-2 5] 𨦇𡚴𠷡𧘕𧘔
+\item[-3 5] 𥝱𨦇𡚴𠷡𧘕
+\item[-4 5] 𡈽𥝱𨦇𡚴𠷡
+\item[-5 5] 𠀋𡈽𥝱𨦇𡚴
+\item[-1 5] 𡚴𠷡𧘕𧘔𩸽
+\item[-2 4] 𡚴𠷡𧘕𧘔
+\item[-3 3] 𡚴𠷡𧘕
+\item[-4 2] 𡚴𠷡
+\item[-5 1] 𡚴
+\item[-1 8] 𡈽𥝱𨦇𡚴𠷡𧘕𧘔𩸽
+\item[-2 7] 𡈽𥝱𨦇𡚴𠷡𧘕𧘔
+\item[-3 6] 𡈽𥝱𨦇𡚴𠷡𧘕
+\item[-4 5] 𡈽𥝱𨦇𡚴𠷡
+\item[-5 4] 𡈽𥝱𨦇𡚴
+\item[-6 3] 𡈽𥝱𨦇
+\item[-7 2] 𡈽𥝱
+\item[-8 1] 𡈽
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/testcase.bst b/biblio/bibtex/bibtex-x/tests/testcase.bst
new file mode 100644
index 0000000000..deb8ab4b5c
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testcase.bst
@@ -0,0 +1,44 @@
+% BibTeX test style file
+% Copyright 2022 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+% You may freely use, modify and/or distribute this file.
+
+ENTRY {field}{}{}
+
+FUNCTION {output_entry} {
+ "\item[~] " field *
+ write$ newline$
+ "\item[u] " field "u" change.case$ *
+ write$ newline$
+ "\item[l] " field "l" change.case$ *
+ write$ newline$
+ "\item[t] " field "t" change.case$ *
+ write$ newline$
+}
+
+FUNCTION {type} {output_entry}
+
+READ
+
+FUNCTION {set_sort_key} {
+ field 'sort.key$ :=
+}
+
+ITERATE {set_sort_key}
+
+SORT
+
+FUNCTION {output_bgn} {
+ "\section*{Test result}" write$ newline$
+ "\begin{itemize}" write$ newline$
+}
+
+FUNCTION {output_end} {
+ "\end{itemize}" write$ newline$
+ "\endinput" write$ newline$
+}
+
+EXECUTE {output_bgn}
+
+ITERATE {call.type$}
+
+EXECUTE {output_end}
diff --git a/biblio/bibtex/bibtex-x/tests/testcasea.bib b/biblio/bibtex/bibtex-x/tests/testcasea.bib
new file mode 100644
index 0000000000..3fd3dcdb79
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testcasea.bib
@@ -0,0 +1,8 @@
+@Type{ascii,
+ field = {ABC HIJ XYZ abc hij xyz {ACE} {ace}},
+}
+
+@Type{latin1,
+ field = { {} {}},
+}
+
diff --git a/biblio/bibtex/bibtex-x/tests/testcaseu.bib b/biblio/bibtex/bibtex-x/tests/testcaseu.bib
new file mode 100644
index 0000000000..961f159553
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testcaseu.bib
@@ -0,0 +1,48 @@
+@Type{ascii,
+ field = {ABC HIJ XYZ abc hij xyz {ACE} {ace}},
+}
+
+@Type{latin1,
+ field = {ÀÁÂ ÆÇÈ ÔÕÖ ØÙÚ ÜÝÞ àáâ æçè ôõö øùú üýþ {ÆÇÈ} {æçè}},
+}
+
+@Type{latin-extA1,
+ field = {ĀĂĄ IJĴĶ ĹĻĽ ŃŅŇ āăą ijĵķ ĺļľ ńņň},
+}
+
+@Type{latin-extA2,
+ field = {ŊŌŎ ŲŴŶ Ÿ ŹŻŽ ŋōŏ ųŵŷ ÿ źżž},
+}
+
+@Type{latin-SharpS,
+ field = {SS S ß s},
+}
+
+@Type{greek1,
+ field = {ΑΒΓ ΠΡ ΣΤ ΧΨΩΪ αβγ πρ στ χψωϊ {ΑΠΣ} {απσ}},
+}
+
+@Type{greek2,
+ field = {ͰͲͶ ϘϚϜ ϪϬϮ Ϸ Ϻ ͱͳͷ ϙϛϝ ϫϭϯ ϸ ϻ},
+}
+
+@Type{cyrillic1,
+ field = {АБВ ОП РС ЭЮЯ абв оп рс эюя {АРЯ} {апя}},
+}
+
+@Type{cyrillic2,
+ field = {ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ ѐёђѓєѕіїјљњћќѝўџ},
+}
+
+@Type{cyrillic3,
+ field = {ѠѢѤ ѼѾҀ ҊҌҎ ҺҼҾ ѡѣѥ ѽѿҁ ҋҍҏ һҽҿ},
+}
+
+@Type{cyrillic4,
+ field = {Ӏ ӁӃӅ ӉӋӍ ӏ ӂӄӆ ӊӌӎ},
+}
+
+@Type{cyrillic5,
+ field = {ӐӒӔ ӺӼӾ ԀԂԄ ԪԬԮ ӑӓӕ ӻӽӿ ԁԃԅ ԫԭԯ},
+}
+
diff --git a/biblio/bibtex/bibtex-x/tests/testchar.bst b/biblio/bibtex/bibtex-x/tests/testchar.bst
new file mode 100644
index 0000000000..d9c778fca9
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testchar.bst
@@ -0,0 +1,40 @@
+% BibTeX test style file
+% Copyright 2022 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+% You may freely use, modify and/or distribute this file.
+
+ENTRY {field}{}{}
+
+FUNCTION {output_entry} {
+ "\item " field * write$
+ " i2str: " field chr.to.int$ int.to.str$ * write$
+ " i2chr: " field chr.to.int$ int.to.chr$ * write$
+ newline$
+}
+
+FUNCTION {type} {output_entry}
+
+READ
+
+FUNCTION {set_sort_key} {
+ field 'sort.key$ :=
+}
+
+ITERATE {set_sort_key}
+
+SORT
+
+FUNCTION {output_bgn} {
+ "\section*{Test result}" write$ newline$
+ "\begin{itemize}" write$ newline$
+}
+
+FUNCTION {output_end} {
+ "\end{itemize}" write$ newline$
+ "\endinput" write$ newline$
+}
+
+EXECUTE {output_bgn}
+
+ITERATE {call.type$}
+
+EXECUTE {output_end}
diff --git a/biblio/bibtex/bibtex-x/tests/testchara.bib b/biblio/bibtex/bibtex-x/tests/testchara.bib
new file mode 100644
index 0000000000..20acd2737e
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testchara.bib
@@ -0,0 +1,18 @@
+@Type{ascii-000, field = {A}, }
+@Type{ascii-001, field = {C}, }
+@Type{ascii-002, field = {D}, }
+@Type{ascii-003, field = {E}, }
+@Type{ascii-005, field = {i}, }
+@Type{ascii-006, field = {o}, }
+@Type{ascii-007, field = {u}, }
+@Type{ascii-008, field = {y}, }
+
+@Type{latin1-000, field = {}, }
+@Type{latin1-001, field = {}, }
+@Type{latin1-002, field = {}, }
+@Type{latin1-003, field = {}, }
+@Type{latin1-005, field = {}, }
+@Type{latin1-006, field = {}, }
+@Type{latin1-007, field = {}, }
+@Type{latin1-008, field = {}, }
+
diff --git a/biblio/bibtex/bibtex-x/tests/testcharu.bib b/biblio/bibtex/bibtex-x/tests/testcharu.bib
new file mode 100644
index 0000000000..e4f7b9b987
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testcharu.bib
@@ -0,0 +1,56 @@
+@Type{ascii-000, field = {A}, }
+@Type{ascii-001, field = {C}, }
+@Type{ascii-002, field = {D}, }
+@Type{ascii-003, field = {E}, }
+@Type{ascii-005, field = {i}, }
+@Type{ascii-006, field = {o}, }
+@Type{ascii-007, field = {u}, }
+@Type{ascii-008, field = {y}, }
+
+@Type{latin1-000, field = {Å}, }
+@Type{latin1-001, field = {Ç}, }
+@Type{latin1-002, field = {Ð}, }
+@Type{latin1-003, field = {È}, }
+@Type{latin1-005, field = {î}, }
+@Type{latin1-006, field = {ø}, }
+@Type{latin1-007, field = {ü}, }
+@Type{latin1-008, field = {ý}, }
+
+@Type{greek-000, field = {Α}, }
+@Type{greek-001, field = {Β}, }
+@Type{greek-002, field = {Γ}, }
+@Type{greek-003, field = {χ}, }
+@Type{greek-004, field = {ψ}, }
+@Type{greek-005, field = {ω}, }
+
+@Type{cyrillic-001, field = {А}, }
+@Type{cyrillic-002, field = {Б}, }
+@Type{cyrillic-003, field = {В}, }
+@Type{cyrillic-004, field = {э}, }
+@Type{cyrillic-005, field = {ю}, }
+@Type{cyrillic-006, field = {я}, }
+
+@Type{kana-001, field = {あ}, }
+@Type{kana-002, field = {い}, }
+@Type{kana-003, field = {う}, }
+@Type{kana-004, field = { }, }
+@Type{kana-005, field = {ヱ}, }
+@Type{kana-006, field = {ヲ}, }
+@Type{kana-007, field = {ン}, }
+
+@Type{hanzi-001, field = {一}, }
+@Type{hanzi-002, field = {二}, }
+@Type{hanzi-003, field = {三}, }
+@Type{hanzi-005, field = {捌}, }
+@Type{hanzi-006, field = {玖}, }
+@Type{hanzi-007, field = {拾}, }
+@Type{hanzi-011, field = {𠮟}, }
+@Type{hanzi-012, field = {𥝱}, }
+
+@Type{hangul-001, field = {가}, }
+@Type{hangul-002, field = {나}, }
+@Type{hangul-003, field = {다}, }
+@Type{hangul-005, field = {한}, }
+@Type{hangul-006, field = {글}, }
+@Type{hangul-007, field = {텍}, }
+
diff --git a/biblio/bibtex/bibtex-x/tests/testdata.bib b/biblio/bibtex/bibtex-x/tests/testdata.bib
new file mode 100644
index 0000000000..c17aa9c838
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testdata.bib
@@ -0,0 +1,43 @@
+@Type{8bit-1,
+ field = {},
+}
+
+@Type{8bit-2,
+ field = {},
+}
+
+@Type{8bit-3,
+ field = {},
+}
+
+@Type{8bit-4,
+ field = {},
+}
+
+@Type{aa,
+ field = {Aa},
+}
+
+@Type{bb,
+ field = {Bb},
+}
+
+@Type{cc,
+ field = {Cc},
+}
+
+@Type{oo,
+ field = {Oo},
+}
+
+@Type{xx,
+ field = {Xx},
+}
+
+@Type{yy,
+ field = {Yy},
+}
+
+@Type{zz,
+ field = {Zz},
+}
diff --git a/biblio/bibtex/bibtex-x/tests/testiscjk.bst b/biblio/bibtex/bibtex-x/tests/testiscjk.bst
new file mode 100644
index 0000000000..c744b6548c
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testiscjk.bst
@@ -0,0 +1,47 @@
+% BibTeXu test style file
+% Copyright 2022 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+% You may freely use, modify and/or distribute this file.
+%
+% Test for built-in functions is.cjk.str$ and is.kanji.str$
+
+ENTRY {field}{}{}
+
+FUNCTION {output_entry} {
+ "\item " field * write$
+ ": " field is.cjk.str$ int.to.str$ * write$
+ " " field is.kanji.str$ int.to.str$ * write$
+ " hz:" field is.cjk.str$ #1 & int.to.str$ * write$
+ " kn:" field is.cjk.str$ #2 & int.to.str$ * write$
+ " hg:" field is.cjk.str$ #4 & int.to.str$ * write$
+ " bp:" field is.cjk.str$ #8 & int.to.str$ * write$
+ " misc:" field is.cjk.str$ #2048 & int.to.str$ * write$
+ newline$
+}
+
+FUNCTION {type} {output_entry}
+
+READ
+
+FUNCTION {set_sort_key} {
+ field 'sort.key$ :=
+}
+
+ITERATE {set_sort_key}
+
+SORT
+
+FUNCTION {output_bgn} {
+ "\section*{Test result}" write$ newline$
+ "\begin{itemize}" write$ newline$
+}
+
+FUNCTION {output_end} {
+ "\end{itemize}" write$ newline$
+ "\endinput" write$ newline$
+}
+
+EXECUTE {output_bgn}
+
+ITERATE {call.type$}
+
+EXECUTE {output_end}
diff --git a/biblio/bibtex/bibtex-x/tests/testiscjku.bib b/biblio/bibtex/bibtex-x/tests/testiscjku.bib
new file mode 100644
index 0000000000..be03f14c31
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testiscjku.bib
@@ -0,0 +1,66 @@
+@Type{ascii-1000, field = {ACDE iouy}, }
+
+@Type{latin1-1000, field = {ÅÇÐÈ îøüý}, }
+@Type{latin1-2000, field = {¢£§©®±µ¶}, }
+@Type{latinExtA-1000, field = {ĂĆĎĘ ĭőůŷ}, }
+
+@Type{greek-1000, field = {ΑΒΓΔφχψω}, }
+
+@Type{cyrillic-1000, field = {АБВГьэюя}, }
+
+@Type{kana-1000, field = {あいうえゐゑをん}, }
+@Type{kana-2000, field = {アイウエヰヱヲン}, }
+@Type{kana-3000, field = {アイウワヲン}, }
+@Type{katakana-phonetic-extensions-1000, field = {ㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ}, }
+@Type{kana-ExtA-1000, field = {𛄀𛄁𛄂𛄃𛄄𛄅𛄆𛄇}, }
+@Type{kana-ExtB-1000, field = {𚿰𚿱𚿲𚿳𚿵𚿶𚿷𚿸}, }
+@Type{small-kana-Ext-1000, field = {𛅐𛅑𛅒𛅤𛅥𛅦𛅧}, }
+
+@Type{hanzi-1000, field = {一二三四漆捌玖拾}, }
+@Type{cjk-ideograph-ExtA-1000, field = {㐂㒵㓛㞍㟢㐆㐬㐮㔫㚑㐧}, }
+@Type{cjk-ideograph-ExtB-1000, field = {櫛杓𦥑𠮟𠀋𡈽𥝱𡚴}, }
+@Type{cjk-compatibility-ideograph-1000, field = {豈更車賈滑串句龜}, }
+@Type{cjk-ideograph-ExtC-1000, field = {𪜀𪜁𪜂𪜃𪜄𪜅𪜆𪜇}, }
+
+@Type{hangul-1000, field = {가나다라마한글텍}, }
+
+@Type{fullw-001, field = {#}, }
+@Type{fullw-002, field = {@}, }
+@Type{fullw-003, field = {A}, }
+@Type{fullw-004, field = {z}, }
+@Type{fullw-005, field = {£}, }
+@Type{fullw-006, field = {₩}, }
+@Type{fullw-007, field = {0}, }
+@Type{fullw-008, field = {9}, }
+
+@Type{symbol-101, field = {☀}, }
+@Type{symbol-102, field = {☁}, }
+@Type{symbol-103, field = {☂}, }
+@Type{symbol-104, field = {☃}, }
+@Type{symbol-105, field = {●}, }
+@Type{symbol-106, field = {△}, }
+@Type{symbol-107, field = {■}, }
+@Type{symbol-108, field = {◇}, }
+@Type{symbol-109, field = {\}, }
+
+@Type{hangul-jamo-1000, field = {ᄀᄁᄂᄃᇶᇷᇸᇹ}, }
+@Type{hangul-compatibilityjamo-1000, field = {ㄱㄲㄳㄴㆉㆊㆋㆌ}, }
+@Type{hangul-jamo-ExtA-1000, field = {ꥠꥡꥢꥣꥤꥥꥦꥧ}, }
+@Type{hangul-jamo-ExtB-1000, field = {ힰힱힲힳힴힵힶힷ}, }
+@Type{cjk-radical-supplement-1000, field = {⺐⺒⺓⺔⺖⺗⺘⺙⻭⻯⻲}, }
+@Type{kangxi-radicals-1000, field = {⿎⿏⿐⿑⿒⿓⿔⿕}, }
+@Type{ideographic-description-char-1000, field = {⿰⿱⿲⿳⿴⿵⿶⿷⿸⿹⿺⿻}, }
+@Type{bopomofo-1000, field = {ㄅㄆㄇㄈㄦㄧㄨㄩ}, }
+@Type{bopomofo-extended-1000, field = {ㆠㆡㆢㆣㆤㆥㆦㆧ}, }
+@Type{kanbun-1000, field = {㆑㆒㆓㆔㆙㆚㆛㆜㆝㆞㆟}, }
+@Type{cjk-strokes-1000, field = {㇀㇁㇂㇃㇠㇡㇢㇣}, }
+
+@Type{cjk-symbols-and-punctuation-1000, field = {〄々〆〇【】〠〽}, }
+@Type{enclosed-cjk-letters-and-months-1000, field = {㈀㈁㈂㈠㈡㈢㈱㋐㋑㋒}, }
+@Type{cjk-compatibility-1000, field = {㌀㌁㌂㌃㌄㌅㌆㌇}, }
+@Type{cjk-compatibility-forms-1000, field = {︵︶︷︸︹︺︻︼︽︾}, }
+
+@Type{mix0, field = {mix てふ나비蝴蝶ㄏㄨˊㄉㄧㄝˊ⾍}, }
+@Type{mix1, field = {mix てふ蝴蝶}, }
+@Type{mix2, field = {mix 蝴蝶ㄏㄨˊㄉㄧㄝˊ⾍}, }
+@Type{mix3, field = {mix 나비蝴蝶}, }
diff --git a/biblio/bibtex/bibtex-x/tests/testname.bst b/biblio/bibtex/bibtex-x/tests/testname.bst
new file mode 100644
index 0000000000..d9addb41d0
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testname.bst
@@ -0,0 +1,64 @@
+% BibTeX test style file
+% Copyright 2022 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+% You may freely use, modify and/or distribute this file.
+
+ENTRY {author}{}{}
+
+STRINGS { s }
+
+INTEGERS { nameptr namesleft numnames }
+
+FUNCTION {format.names}
+{ 's :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { " [" nameptr int.to.str$ * "]" * write$
+ " {ff} " s nameptr "{ff}" format.name$ * write$
+ " {ll} " s nameptr "{ll}" format.name$ * write$
+ " {vv} " s nameptr "{vv}" format.name$ * write$
+ " {jj} " s nameptr "{jj}" format.name$ * write$ newline$
+ " | " s nameptr "{ff}{vv}{ll}{jj}" format.name$ * write$
+ " | " s nameptr "{ff }{vv }{ll}{ jj}" format.name$ * write$
+ " | " s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ * write$
+ " | " s nameptr "{f.~}{v.~}{ll}{, jj}" format.name$ * write$
+ newline$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+}
+
+FUNCTION {output_entry} {
+ "\item " author * write$ newline$
+ author format.names
+}
+
+FUNCTION {book} {output_entry}
+
+READ
+
+FUNCTION {set_sort_key} {
+ author 'sort.key$ :=
+}
+
+ITERATE {set_sort_key}
+
+SORT
+
+FUNCTION {output_bgn} {
+ "\section*{Test result}" write$ newline$
+ "\begin{itemize}" write$ newline$
+}
+
+FUNCTION {output_end} {
+ "\end{itemize}" write$ newline$
+ "\endinput" write$ newline$
+}
+
+EXECUTE {output_bgn}
+
+ITERATE {call.type$}
+
+EXECUTE {output_end}
diff --git a/biblio/bibtex/bibtex-x/tests/testperiod.bst b/biblio/bibtex/bibtex-x/tests/testperiod.bst
new file mode 100644
index 0000000000..b597eb00c9
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testperiod.bst
@@ -0,0 +1,40 @@
+% BibTeX test style file
+% Copyright 2022 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+% You may freely use, modify and/or distribute this file.
+
+ENTRY {field}{}{}
+
+FUNCTION {output_entry} {
+ "\item[~~] " field *
+ write$ newline$
+ "\item[ap] " field add.period$ *
+ write$ newline$
+}
+
+FUNCTION {type} {output_entry}
+
+READ
+
+FUNCTION {set_sort_key} {
+ field 'sort.key$ :=
+}
+
+ITERATE {set_sort_key}
+
+SORT
+
+FUNCTION {output_bgn} {
+ "\section*{Test result}" write$ newline$
+ "\begin{itemize}" write$ newline$
+}
+
+FUNCTION {output_end} {
+ "\end{itemize}" write$ newline$
+ "\endinput" write$ newline$
+}
+
+EXECUTE {output_bgn}
+
+ITERATE {call.type$}
+
+EXECUTE {output_end}
diff --git a/biblio/bibtex/bibtex-x/tests/testperioda.bib b/biblio/bibtex/bibtex-x/tests/testperioda.bib
new file mode 100644
index 0000000000..047ad091dc
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testperioda.bib
@@ -0,0 +1,8 @@
+@Type{abc0, field = {ABC xyz}, }
+@Type{abc1, field = {ABC xyz.}, }
+@Type{abc2, field = {ABC xyz!}, }
+@Type{abc3, field = {ABC xyz?}, }
+@Type{abc4, field = {ABC xyz,}, }
+@Type{abc5, field = {ABC {xyz!}}, }
+@Type{abc6, field = {ABC {{xyz?}}}, }
+
diff --git a/biblio/bibtex/bibtex-x/tests/testperiodu.bib b/biblio/bibtex/bibtex-x/tests/testperiodu.bib
new file mode 100644
index 0000000000..e6bd30ba54
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testperiodu.bib
@@ -0,0 +1,33 @@
+@Type{abc0, field = {ABC xyz}, }
+@Type{abc1, field = {ABC xyz.}, }
+@Type{abc2, field = {ABC xyz!}, }
+@Type{abc3, field = {ABC xyz?}, }
+@Type{abc4, field = {ABC xyz,}, }
+@Type{abc5, field = {ABC {xyz!}}, }
+@Type{abc6, field = {ABC {{xyz?}}}, }
+
+@Type{cyrillic0, field = {АБВ эюя}, }
+@Type{cyrillic1, field = {АБВ эюя.}, }
+@Type{cyrillic2, field = {АБВ эюя!}, }
+@Type{cyrillic3, field = {АБВ эюя?}, }
+@Type{cyrillic4, field = {АБВ эюя,}, }
+@Type{cyrillic5, field = {АБВ {эюя!}}, }
+@Type{cyrillic6, field = {АБВ {{эюя?}}}, }
+
+@Type{aiu0, field = {あいうわおん}, }
+@Type{aiu1, field = {あいうわおん。}, }
+@Type{aiu2, field = {あいうわおん.}, }
+@Type{aiu3, field = {あいうわおん!}, }
+@Type{aiu4, field = {あいうわおん?}, }
+@Type{aiu5, field = {あいうわおん‼}, }
+@Type{aiu6, field = {あいうわおん⁇}, }
+@Type{aiu7, field = {あいうわおん⁈}, }
+@Type{aiu8, field = {あいうわおん⁉}, }
+@Type{aiu9, field = {あいうわおん‽}, }
+@Type{aiuA, field = {あいうわおん、}, }
+@Type{aiuB, field = {あいうわおん,}, }
+@Type{aiuC, field = {あいうわ{おん!}}, }
+@Type{aiuD, field = {あいうわ{{おん?}}}, }
+@Type{aiuE, field = {あいうわ{{{おん‼}}}}, }
+@Type{aiuF, field = {あいうわ{{{{おん⁇}}}}}, }
+
diff --git a/biblio/bibtex/bibtex-x/tests/testsortu.bib b/biblio/bibtex/bibtex-x/tests/testsortu.bib
new file mode 100644
index 0000000000..0d7b6253ae
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testsortu.bib
@@ -0,0 +1,27 @@
+@Type{8bit-1, field = {Øø}, }
+@Type{8bit-2, field = {Åå}, }
+@Type{8bit-3, field = {Ää}, }
+@Type{8bit-4, field = {Öö}, }
+
+@Type{aa, field = {Aa}, }
+@Type{bb, field = {Bb}, }
+@Type{cc, field = {Cc}, }
+@Type{oo, field = {Oo}, }
+@Type{xx, field = {Xx}, }
+@Type{yy, field = {Yy}, }
+@Type{zz, field = {Zz}, }
+
+@Type{greek1, field = {Αα}, }
+@Type{greek2, field = {Ββ}, }
+@Type{greek3, field = {Γγ}, }
+@Type{greek4, field = {Χχ}, }
+@Type{greek5, field = {Ψψ}, }
+@Type{greek6, field = {Ωω}, }
+
+@Type{cyrillic1, field = {Аа}, }
+@Type{cyrillic2, field = {Бб}, }
+@Type{cyrillic3, field = {Вв}, }
+@Type{cyrillic4, field = {Ээ}, }
+@Type{cyrillic5, field = {Юю}, }
+@Type{cyrillic6, field = {Яя}, }
+
diff --git a/biblio/bibtex/bibtex-x/tests/teststyle.bst b/biblio/bibtex/bibtex-x/tests/teststyle.bst
new file mode 100644
index 0000000000..72f7525c7b
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/teststyle.bst
@@ -0,0 +1,36 @@
+ENTRY {field}{}{}
+
+FUNCTION {output_entry} {
+ "\item " field * " " *
+ field "u" change.case$ * " " *
+ field "l" change.case$ *
+ write$ newline$
+}
+
+FUNCTION {type} {output_entry}
+
+READ
+
+FUNCTION {set_sortkey} {
+ field 'sort.key$ :=
+}
+
+ITERATE {set_sortkey}
+
+SORT
+
+FUNCTION {output_beg} {
+ "\section*{Test result}" write$ newline$
+ "\begin{itemize}" write$ newline$
+}
+
+FUNCTION {output_end} {
+ "\end{itemize}" write$ newline$
+ "\endinput" write$ newline$
+}
+
+EXECUTE {output_beg}
+
+ITERATE {call.type$}
+
+EXECUTE {output_end}
diff --git a/biblio/bibtex/bibtex-x/tests/testsubstr.bst b/biblio/bibtex/bibtex-x/tests/testsubstr.bst
new file mode 100644
index 0000000000..a332f82a00
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testsubstr.bst
@@ -0,0 +1,91 @@
+% BibTeX test style file
+% Copyright 2022 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+% You may freely use, modify and/or distribute this file.
+
+ENTRY {field}{}{}
+
+FUNCTION {output_entry} {
+ "\item[orig] " field * write$ newline$
+ "\item[1 5] " field #1 #5 substring$ * write$ newline$
+ "\item[1 4] " field #1 #4 substring$ * write$ newline$
+ "\item[1 3] " field #1 #3 substring$ * write$ newline$
+ "\item[1 2] " field #1 #2 substring$ * write$ newline$
+ "\item[1 1] " field #1 #1 substring$ * write$ newline$
+ "\item[2 1] " field #2 #1 substring$ * write$ newline$
+ "\item[3 1] " field #3 #1 substring$ * write$ newline$
+ "\item[4 1] " field #4 #1 substring$ * write$ newline$
+ "\item[5 1] " field #5 #1 substring$ * write$ newline$
+ "\item[1 5] " field #1 #5 substring$ * write$ newline$
+ "\item[2 5] " field #2 #5 substring$ * write$ newline$
+ "\item[3 5] " field #3 #5 substring$ * write$ newline$
+ "\item[4 5] " field #4 #5 substring$ * write$ newline$
+ "\item[5 5] " field #5 #5 substring$ * write$ newline$
+ "\item[1 5] " field #1 #5 substring$ * write$ newline$
+ "\item[2 4] " field #2 #4 substring$ * write$ newline$
+ "\item[3 3] " field #3 #3 substring$ * write$ newline$
+ "\item[4 2] " field #4 #2 substring$ * write$ newline$
+ "\item[5 1] " field #5 #1 substring$ * write$ newline$
+ "\item[1 8] " field #1 #8 substring$ * write$ newline$
+ "\item[2 7] " field #2 #7 substring$ * write$ newline$
+ "\item[3 6] " field #3 #6 substring$ * write$ newline$
+ "\item[4 5] " field #4 #5 substring$ * write$ newline$
+ "\item[5 4] " field #5 #4 substring$ * write$ newline$
+ "\item[6 3] " field #6 #3 substring$ * write$ newline$
+ "\item[7 2] " field #7 #2 substring$ * write$ newline$
+ "\item[8 1] " field #8 #1 substring$ * write$ newline$
+ "\item[-1 5] " field #-1 #5 substring$ * write$ newline$
+ "\item[-1 4] " field #-1 #4 substring$ * write$ newline$
+ "\item[-1 3] " field #-1 #3 substring$ * write$ newline$
+ "\item[-1 2] " field #-1 #2 substring$ * write$ newline$
+ "\item[-1 1] " field #-1 #1 substring$ * write$ newline$
+ "\item[-2 1] " field #-2 #1 substring$ * write$ newline$
+ "\item[-3 1] " field #-3 #1 substring$ * write$ newline$
+ "\item[-4 1] " field #-4 #1 substring$ * write$ newline$
+ "\item[-5 1] " field #-5 #1 substring$ * write$ newline$
+ "\item[-1 5] " field #-1 #5 substring$ * write$ newline$
+ "\item[-2 5] " field #-2 #5 substring$ * write$ newline$
+ "\item[-3 5] " field #-3 #5 substring$ * write$ newline$
+ "\item[-4 5] " field #-4 #5 substring$ * write$ newline$
+ "\item[-5 5] " field #-5 #5 substring$ * write$ newline$
+ "\item[-1 5] " field #-1 #5 substring$ * write$ newline$
+ "\item[-2 4] " field #-2 #4 substring$ * write$ newline$
+ "\item[-3 3] " field #-3 #3 substring$ * write$ newline$
+ "\item[-4 2] " field #-4 #2 substring$ * write$ newline$
+ "\item[-5 1] " field #-5 #1 substring$ * write$ newline$
+ "\item[-1 8] " field #-1 #8 substring$ * write$ newline$
+ "\item[-2 7] " field #-2 #7 substring$ * write$ newline$
+ "\item[-3 6] " field #-3 #6 substring$ * write$ newline$
+ "\item[-4 5] " field #-4 #5 substring$ * write$ newline$
+ "\item[-5 4] " field #-5 #4 substring$ * write$ newline$
+ "\item[-6 3] " field #-6 #3 substring$ * write$ newline$
+ "\item[-7 2] " field #-7 #2 substring$ * write$ newline$
+ "\item[-8 1] " field #-8 #1 substring$ * write$ newline$
+}
+
+FUNCTION {type} {output_entry}
+
+READ
+
+FUNCTION {set_sort_key} {
+ field 'sort.key$ :=
+}
+
+ITERATE {set_sort_key}
+
+SORT
+
+FUNCTION {output_bgn} {
+ "\section*{Test result}" write$ newline$
+ "\begin{itemize}" write$ newline$
+}
+
+FUNCTION {output_end} {
+ "\end{itemize}" write$ newline$
+ "\endinput" write$ newline$
+}
+
+EXECUTE {output_bgn}
+
+ITERATE {call.type$}
+
+EXECUTE {output_end}
diff --git a/biblio/bibtex/bibtex-x/tests/testsubstra.bib b/biblio/bibtex/bibtex-x/tests/testsubstra.bib
new file mode 100644
index 0000000000..4ceeccac63
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testsubstra.bib
@@ -0,0 +1,21 @@
+@Type{ascii,
+ field = {ABCDEFG tuvwxyz},
+}
+@Type{ascii-a,
+ field = {{AB}CDEFG tuvwx{yz}},
+}
+@Type{ascii-b,
+ field = {{{AB}CD}EFG tuv{wx{yz}}},
+}
+
+@Type{latin1,
+ field = {~},
+}
+@Type{latin1-b,
+ field = {{{}}~{{}}},
+}
+
+@Type{brace-backslash1,
+ field = "{\a}{\b}{\c}",
+}
+
diff --git a/biblio/bibtex/bibtex-x/tests/testsubstru.bib b/biblio/bibtex/bibtex-x/tests/testsubstru.bib
new file mode 100644
index 0000000000..a77db5354f
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testsubstru.bib
@@ -0,0 +1,59 @@
+@Type{ascii,
+ field = {ABCDEFG tuvwxyz},
+}
+@Type{ascii-a,
+ field = {{AB}CDEFG tuvwx{yz}},
+}
+@Type{ascii-b,
+ field = {{{AB}CD}EFG tuv{wx{yz}}},
+}
+
+@Type{latin1,
+ field = {ÅÇÈÎØÜÝ~åçèîøüý},
+}
+@Type{latin1-b,
+ field = {{{ÅÇ}ÈÎ}ØÜÝ~åçè{îø{üý}}},
+}
+
+@Type{greek,
+ field = {ΑΒΓΔΕΖΗ στυφχψω},
+}
+
+@Type{cyrillic,
+ field = {АБВГДЕЖ щъыьэюя},
+}
+
+@Type{kana,
+ field = {あいうえおかき ユヨワヰヱヲン},
+}
+
+@Type{hanzi,
+ field = {一二三四五六七 肆伍陸漆捌玖拾},
+}
+@Type{hanzi-b,
+ field = {{{一二}三四}五六七 肆伍陸{漆捌{玖拾}}},
+}
+
+@Type{hanzi2,
+ field = {櫛杓屠冤𦥑𠮟𠀋𡈽𥝱𨦇𡚴𠷡𧘕𧘔𩸽},
+}
+@Type{hanzi2-b,
+ field = {{{櫛杓}屠冤}𦥑𠮟𠀋𡈽𥝱𨦇𡚴{𠷡𧘕{𧘔𩸽}}},
+}
+
+@Type{mix,
+ field = {AÇう冤EÜЖ~tçユ漆𡚴xюω},
+}
+
+@Type{brace-backslash1,
+ field = "{\a}Åå{\b}Ææ{\c}Çç",
+}
+
+@Type{brace-backslash2,
+ field = "{\a}αあ{\b}βい{\c}γう",
+}
+
+@Type{brace-backslash3,
+ field = "{\a}あα{\b}いβ{\c}うγ",
+}
+
diff --git a/biblio/bibtex/bibtex-x/tests/testtxtprfx.bst b/biblio/bibtex/bibtex-x/tests/testtxtprfx.bst
new file mode 100644
index 0000000000..20383dc2c1
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testtxtprfx.bst
@@ -0,0 +1,45 @@
+% BibTeX test style file
+% Copyright 2022 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+% You may freely use, modify and/or distribute this file.
+
+ENTRY {field}{}{}
+
+FUNCTION {output_entry} {
+ "\item[orig] " field * write$ newline$
+ "\item[len] " field text.length$ int.to.str$ * write$ newline$
+ "\item[1] " field #1 text.prefix$ * write$ newline$
+ "\item[2] " field #2 text.prefix$ * write$ newline$
+ "\item[3] " field #3 text.prefix$ * write$ newline$
+ "\item[4] " field #4 text.prefix$ * write$ newline$
+ "\item[5] " field #5 text.prefix$ * write$ newline$
+ "\item[6] " field #6 text.prefix$ * write$ newline$
+ "\item[7] " field #7 text.prefix$ * write$ newline$
+}
+
+FUNCTION {type} {output_entry}
+
+READ
+
+FUNCTION {set_sort_key} {
+ field 'sort.key$ :=
+}
+
+ITERATE {set_sort_key}
+
+SORT
+
+FUNCTION {output_bgn} {
+ "\section*{Test result}" write$ newline$
+ "\begin{itemize}" write$ newline$
+}
+
+FUNCTION {output_end} {
+ "\end{itemize}" write$ newline$
+ "\endinput" write$ newline$
+}
+
+EXECUTE {output_bgn}
+
+ITERATE {call.type$}
+
+EXECUTE {output_end}
diff --git a/biblio/bibtex/bibtex-x/tests/testwidth.bst b/biblio/bibtex/bibtex-x/tests/testwidth.bst
new file mode 100644
index 0000000000..2af9d8c388
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testwidth.bst
@@ -0,0 +1,38 @@
+% BibTeX test style file
+% Copyright 2022 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+% You may freely use, modify and/or distribute this file.
+
+ENTRY {field}{}{}
+
+FUNCTION {output_entry} {
+ "\item " field width$ int.to.str$ * write$
+ " " field * write$ newline$
+}
+
+FUNCTION {type} {output_entry}
+
+READ
+
+FUNCTION {set_sort_key} {
+ field 'sort.key$ :=
+}
+
+ITERATE {set_sort_key}
+
+SORT
+
+FUNCTION {output_bgn} {
+ "\section*{Test result}" write$ newline$
+ "\begin{itemize}" write$ newline$
+}
+
+FUNCTION {output_end} {
+ "\end{itemize}" write$ newline$
+ "\endinput" write$ newline$
+}
+
+EXECUTE {output_bgn}
+
+ITERATE {call.type$}
+
+EXECUTE {output_end}
diff --git a/biblio/bibtex/bibtex-x/tests/testwidtha.bib b/biblio/bibtex/bibtex-x/tests/testwidtha.bib
new file mode 100644
index 0000000000..f4cd21e57f
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testwidtha.bib
@@ -0,0 +1,155 @@
+@Type{ascii-1000, field = {ACDE iouy}, }
+
+@Type{latin1-1000, field = { }, }
+
+@Type{ascii-021, field = {!}, }
+@Type{ascii-022, field = {"}, }
+@Type{ascii-023, field = {#}, }
+@Type{ascii-024, field = {$}, }
+@Type{ascii-025, field = {%}, }
+@Type{ascii-026, field = {&}, }
+@Type{ascii-02A, field = {*}, }
+@Type{ascii-02B, field = {+}, }
+@Type{ascii-03C, field = {<}, }
+@Type{ascii-03D, field = {=}, }
+@Type{ascii-03E, field = {>}, }
+@Type{ascii-03F, field = {?}, }
+@Type{ascii-040, field = {@}, }
+@Type{ascii-041, field = {A}, }
+@Type{ascii-042, field = {B}, }
+@Type{ascii-043, field = {C}, }
+@Type{ascii-044, field = {D}, }
+@Type{ascii-045, field = {E}, }
+@Type{ascii-046, field = {F}, }
+@Type{ascii-047, field = {G}, }
+@Type{ascii-048, field = {H}, }
+@Type{ascii-049, field = {I}, }
+@Type{ascii-04A, field = {J}, }
+@Type{ascii-04B, field = {K}, }
+@Type{ascii-04C, field = {L}, }
+@Type{ascii-04D, field = {M}, }
+@Type{ascii-04E, field = {N}, }
+@Type{ascii-04F, field = {O}, }
+@Type{ascii-050, field = {P}, }
+@Type{ascii-051, field = {Q}, }
+@Type{ascii-052, field = {R}, }
+@Type{ascii-053, field = {S}, }
+@Type{ascii-054, field = {T}, }
+@Type{ascii-055, field = {U}, }
+@Type{ascii-056, field = {V}, }
+@Type{ascii-057, field = {W}, }
+@Type{ascii-058, field = {X}, }
+@Type{ascii-059, field = {Y}, }
+@Type{ascii-05A, field = {Z}, }
+@Type{ascii-061, field = {a}, }
+@Type{ascii-062, field = {b}, }
+@Type{ascii-063, field = {c}, }
+@Type{ascii-064, field = {d}, }
+@Type{ascii-065, field = {e}, }
+@Type{ascii-066, field = {f}, }
+@Type{ascii-067, field = {g}, }
+@Type{ascii-068, field = {h}, }
+@Type{ascii-069, field = {i}, }
+@Type{ascii-06A, field = {j}, }
+@Type{ascii-06B, field = {k}, }
+@Type{ascii-06C, field = {l}, }
+@Type{ascii-06D, field = {m}, }
+@Type{ascii-06E, field = {n}, }
+@Type{ascii-06F, field = {o}, }
+@Type{ascii-070, field = {p}, }
+@Type{ascii-071, field = {q}, }
+@Type{ascii-072, field = {r}, }
+@Type{ascii-073, field = {s}, }
+@Type{ascii-074, field = {t}, }
+@Type{ascii-075, field = {u}, }
+@Type{ascii-076, field = {v}, }
+@Type{ascii-077, field = {w}, }
+@Type{ascii-078, field = {x}, }
+@Type{ascii-079, field = {y}, }
+@Type{ascii-07A, field = {z}, }
+@Type{ascii-000, field = {0}, }
+@Type{ascii-001, field = {1}, }
+@Type{ascii-002, field = {2}, }
+@Type{ascii-003, field = {3}, }
+@Type{ascii-004, field = {4}, }
+@Type{ascii-005, field = {5}, }
+@Type{ascii-006, field = {6}, }
+@Type{ascii-007, field = {7}, }
+@Type{ascii-008, field = {8}, }
+@Type{ascii-009, field = {9}, }
+
+@Type{latin1-0A1, field = {}, }
+@Type{latin1-0A3, field = {}, }
+@Type{latin1-0A7, field = {}, }
+@Type{latin1-0AB, field = {}, }
+@Type{latin1-0BB, field = {}, }
+@Type{latin1-0BF, field = {}, }
+@Type{latin1-0C0, field = {}, }
+@Type{latin1-0C1, field = {}, }
+@Type{latin1-0C2, field = {}, }
+@Type{latin1-0C3, field = {}, }
+@Type{latin1-0C4, field = {}, }
+@Type{latin1-0C5, field = {}, }
+@Type{latin1-0C6, field = {}, }
+@Type{latin1-0C7, field = {}, }
+@Type{latin1-0C8, field = {}, }
+@Type{latin1-0C9, field = {}, }
+@Type{latin1-0CA, field = {}, }
+@Type{latin1-0CB, field = {}, }
+@Type{latin1-0CC, field = {}, }
+@Type{latin1-0CD, field = {}, }
+@Type{latin1-0CE, field = {}, }
+@Type{latin1-0CF, field = {}, }
+@Type{latin1-0D0, field = {}, }
+@Type{latin1-0D1, field = {}, }
+@Type{latin1-0D2, field = {}, }
+@Type{latin1-0D3, field = {}, }
+@Type{latin1-0D4, field = {}, }
+@Type{latin1-0D5, field = {}, }
+@Type{latin1-0D6, field = {}, }
+@Type{latin1-0D7, field = {}, }
+@Type{latin1-0D8, field = {}, }
+@Type{latin1-0D9, field = {}, }
+@Type{latin1-0DA, field = {}, }
+@Type{latin1-0DB, field = {}, }
+@Type{latin1-0DC, field = {}, }
+@Type{latin1-0DD, field = {}, }
+@Type{latin1-0DE, field = {}, }
+@Type{latin1-0DF, field = {}, }
+@Type{latin1-0E0, field = {}, }
+@Type{latin1-0E1, field = {}, }
+@Type{latin1-0E2, field = {}, }
+@Type{latin1-0E3, field = {}, }
+@Type{latin1-0E4, field = {}, }
+@Type{latin1-0E5, field = {}, }
+@Type{latin1-0E6, field = {}, }
+@Type{latin1-0E7, field = {}, }
+@Type{latin1-0E8, field = {}, }
+@Type{latin1-0E9, field = {}, }
+@Type{latin1-0EA, field = {}, }
+@Type{latin1-0EB, field = {}, }
+@Type{latin1-0EC, field = {}, }
+@Type{latin1-0ED, field = {}, }
+@Type{latin1-0EE, field = {}, }
+@Type{latin1-0EF, field = {}, }
+@Type{latin1-0F0, field = {}, }
+@Type{latin1-0F1, field = {}, }
+@Type{latin1-0F2, field = {}, }
+@Type{latin1-0F3, field = {}, }
+@Type{latin1-0F4, field = {}, }
+@Type{latin1-0F5, field = {}, }
+@Type{latin1-0F6, field = {}, }
+@Type{latin1-0F7, field = {}, }
+@Type{latin1-0F8, field = {}, }
+@Type{latin1-0F9, field = {}, }
+@Type{latin1-0FA, field = {}, }
+@Type{latin1-0FB, field = {}, }
+@Type{latin1-0FC, field = {}, }
+@Type{latin1-0FD, field = {}, }
+@Type{latin1-0FE, field = {}, }
+@Type{latin1-0FF, field = {}, }
+
+@Type{ascii-long-100, field = {LONG long LONG long LONG long LONG long LONG long LONG long LONG long LONG long}, }
+@Type{ascii-long-101, field = {LONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlong LONG long}, }
+@Type{latin1-long-100, field = { }, }
+@Type{latin1-long-101, field = { }, }
diff --git a/biblio/bibtex/bibtex-x/tests/testwidthu.bib b/biblio/bibtex/bibtex-x/tests/testwidthu.bib
new file mode 100644
index 0000000000..71ef3dba7c
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/testwidthu.bib
@@ -0,0 +1,378 @@
+@Type{ascii-1000, field = {ACDE iouy}, }
+
+@Type{latin1-1000, field = {ÅÇÐÈ îøüý}, }
+
+@Type{latinExtA-1000, field = {ĂĆĎĘ ĭőůŷ}, }
+
+@Type{ascii-021, field = {!}, }
+@Type{ascii-022, field = {"}, }
+@Type{ascii-023, field = {#}, }
+@Type{ascii-024, field = {$}, }
+@Type{ascii-025, field = {%}, }
+@Type{ascii-026, field = {&}, }
+@Type{ascii-02A, field = {*}, }
+@Type{ascii-02B, field = {+}, }
+@Type{ascii-03C, field = {<}, }
+@Type{ascii-03D, field = {=}, }
+@Type{ascii-03E, field = {>}, }
+@Type{ascii-03F, field = {?}, }
+@Type{ascii-040, field = {@}, }
+@Type{ascii-041, field = {A}, }
+@Type{ascii-042, field = {B}, }
+@Type{ascii-043, field = {C}, }
+@Type{ascii-044, field = {D}, }
+@Type{ascii-045, field = {E}, }
+@Type{ascii-046, field = {F}, }
+@Type{ascii-047, field = {G}, }
+@Type{ascii-048, field = {H}, }
+@Type{ascii-049, field = {I}, }
+@Type{ascii-04A, field = {J}, }
+@Type{ascii-04B, field = {K}, }
+@Type{ascii-04C, field = {L}, }
+@Type{ascii-04D, field = {M}, }
+@Type{ascii-04E, field = {N}, }
+@Type{ascii-04F, field = {O}, }
+@Type{ascii-050, field = {P}, }
+@Type{ascii-051, field = {Q}, }
+@Type{ascii-052, field = {R}, }
+@Type{ascii-053, field = {S}, }
+@Type{ascii-054, field = {T}, }
+@Type{ascii-055, field = {U}, }
+@Type{ascii-056, field = {V}, }
+@Type{ascii-057, field = {W}, }
+@Type{ascii-058, field = {X}, }
+@Type{ascii-059, field = {Y}, }
+@Type{ascii-05A, field = {Z}, }
+@Type{ascii-061, field = {a}, }
+@Type{ascii-062, field = {b}, }
+@Type{ascii-063, field = {c}, }
+@Type{ascii-064, field = {d}, }
+@Type{ascii-065, field = {e}, }
+@Type{ascii-066, field = {f}, }
+@Type{ascii-067, field = {g}, }
+@Type{ascii-068, field = {h}, }
+@Type{ascii-069, field = {i}, }
+@Type{ascii-06A, field = {j}, }
+@Type{ascii-06B, field = {k}, }
+@Type{ascii-06C, field = {l}, }
+@Type{ascii-06D, field = {m}, }
+@Type{ascii-06E, field = {n}, }
+@Type{ascii-06F, field = {o}, }
+@Type{ascii-070, field = {p}, }
+@Type{ascii-071, field = {q}, }
+@Type{ascii-072, field = {r}, }
+@Type{ascii-073, field = {s}, }
+@Type{ascii-074, field = {t}, }
+@Type{ascii-075, field = {u}, }
+@Type{ascii-076, field = {v}, }
+@Type{ascii-077, field = {w}, }
+@Type{ascii-078, field = {x}, }
+@Type{ascii-079, field = {y}, }
+@Type{ascii-07A, field = {z}, }
+@Type{ascii-000, field = {0}, }
+@Type{ascii-001, field = {1}, }
+@Type{ascii-002, field = {2}, }
+@Type{ascii-003, field = {3}, }
+@Type{ascii-004, field = {4}, }
+@Type{ascii-005, field = {5}, }
+@Type{ascii-006, field = {6}, }
+@Type{ascii-007, field = {7}, }
+@Type{ascii-008, field = {8}, }
+@Type{ascii-009, field = {9}, }
+
+@Type{latin1-0A1, field = {¡}, }
+@Type{latin1-0A3, field = {£}, }
+@Type{latin1-0A7, field = {§}, }
+@Type{latin1-0AB, field = {«}, }
+@Type{latin1-0BB, field = {»}, }
+@Type{latin1-0BF, field = {¿}, }
+@Type{latin1-0C0, field = {À}, }
+@Type{latin1-0C1, field = {Á}, }
+@Type{latin1-0C2, field = {Â}, }
+@Type{latin1-0C3, field = {Ã}, }
+@Type{latin1-0C4, field = {Ä}, }
+@Type{latin1-0C5, field = {Å}, }
+@Type{latin1-0C6, field = {Æ}, }
+@Type{latin1-0C7, field = {Ç}, }
+@Type{latin1-0C8, field = {È}, }
+@Type{latin1-0C9, field = {É}, }
+@Type{latin1-0CA, field = {Ê}, }
+@Type{latin1-0CB, field = {Ë}, }
+@Type{latin1-0CC, field = {Ì}, }
+@Type{latin1-0CD, field = {Í}, }
+@Type{latin1-0CE, field = {Î}, }
+@Type{latin1-0CF, field = {Ï}, }
+@Type{latin1-0D0, field = {Ð}, }
+@Type{latin1-0D1, field = {Ñ}, }
+@Type{latin1-0D2, field = {Ò}, }
+@Type{latin1-0D3, field = {Ó}, }
+@Type{latin1-0D4, field = {Ô}, }
+@Type{latin1-0D5, field = {Õ}, }
+@Type{latin1-0D6, field = {Ö}, }
+@Type{latin1-0D7, field = {×}, }
+@Type{latin1-0D8, field = {Ø}, }
+@Type{latin1-0D9, field = {Ù}, }
+@Type{latin1-0DA, field = {Ú}, }
+@Type{latin1-0DB, field = {Û}, }
+@Type{latin1-0DC, field = {Ü}, }
+@Type{latin1-0DD, field = {Ý}, }
+@Type{latin1-0DE, field = {Þ}, }
+@Type{latin1-0DF, field = {ß}, }
+@Type{latin1-0E0, field = {à}, }
+@Type{latin1-0E1, field = {á}, }
+@Type{latin1-0E2, field = {â}, }
+@Type{latin1-0E3, field = {ã}, }
+@Type{latin1-0E4, field = {ä}, }
+@Type{latin1-0E5, field = {å}, }
+@Type{latin1-0E6, field = {æ}, }
+@Type{latin1-0E7, field = {ç}, }
+@Type{latin1-0E8, field = {è}, }
+@Type{latin1-0E9, field = {é}, }
+@Type{latin1-0EA, field = {ê}, }
+@Type{latin1-0EB, field = {ë}, }
+@Type{latin1-0EC, field = {ì}, }
+@Type{latin1-0ED, field = {í}, }
+@Type{latin1-0EE, field = {î}, }
+@Type{latin1-0EF, field = {ï}, }
+@Type{latin1-0F0, field = {ð}, }
+@Type{latin1-0F1, field = {ñ}, }
+@Type{latin1-0F2, field = {ò}, }
+@Type{latin1-0F3, field = {ó}, }
+@Type{latin1-0F4, field = {ô}, }
+@Type{latin1-0F5, field = {õ}, }
+@Type{latin1-0F6, field = {ö}, }
+@Type{latin1-0F7, field = {÷}, }
+@Type{latin1-0F8, field = {ø}, }
+@Type{latin1-0F9, field = {ù}, }
+@Type{latin1-0FA, field = {ú}, }
+@Type{latin1-0FB, field = {û}, }
+@Type{latin1-0FC, field = {ü}, }
+@Type{latin1-0FD, field = {ý}, }
+@Type{latin1-0FE, field = {þ}, }
+@Type{latin1-0FF, field = {ÿ}, }
+
+@Type{greek-000, field = {Α}, }
+@Type{greek-001, field = {Β}, }
+@Type{greek-002, field = {Γ}, }
+@Type{greek-003, field = {χ}, }
+@Type{greek-004, field = {ψ}, }
+@Type{greek-005, field = {ω}, }
+@Type{greek-100, field = {ΑΒΓ χψω}, }
+
+@Type{cyrillic-001, field = {А}, }
+@Type{cyrillic-002, field = {Б}, }
+@Type{cyrillic-003, field = {В}, }
+@Type{cyrillic-004, field = {э}, }
+@Type{cyrillic-005, field = {ю}, }
+@Type{cyrillic-006, field = {я}, }
+@Type{cyrillic-100, field = {АБВ эюя}, }
+
+@Type{kana-001, field = {あ}, }
+@Type{kana-002, field = {い}, }
+@Type{kana-003, field = {う}, }
+@Type{kana-004, field = { }, }
+@Type{kana-005, field = {ヱ}, }
+@Type{kana-006, field = {ヲ}, }
+@Type{kana-007, field = {ン}, }
+@Type{kana-100, field = {あいう ヱヲン}, }
+
+@Type{hanzi-001, field = {一}, }
+@Type{hanzi-002, field = {二}, }
+@Type{hanzi-003, field = {三}, }
+@Type{hanzi-005, field = {捌}, }
+@Type{hanzi-006, field = {玖}, }
+@Type{hanzi-007, field = {拾}, }
+@Type{hanzi-011, field = {𠮟}, }
+@Type{hanzi-012, field = {𥝱}, }
+@Type{hanzi-100, field = {一二三 捌玖拾}, }
+
+@Type{hangul-001, field = {가}, }
+@Type{hangul-002, field = {나}, }
+@Type{hangul-003, field = {다}, }
+@Type{hangul-005, field = {한}, }
+@Type{hangul-006, field = {글}, }
+@Type{hangul-007, field = {텍}, }
+@Type{hangul-100, field = {가나다한글텍}, }
+
+@Type{latinExtA-100, field = {Ā}, }
+@Type{latinExtA-101, field = {ā}, }
+@Type{latinExtA-102, field = {Ă}, }
+@Type{latinExtA-103, field = {ă}, }
+@Type{latinExtA-104, field = {Ą}, }
+@Type{latinExtA-105, field = {ą}, }
+@Type{latinExtA-106, field = {Ć}, }
+@Type{latinExtA-107, field = {ć}, }
+@Type{latinExtA-108, field = {Ĉ}, }
+@Type{latinExtA-109, field = {ĉ}, }
+@Type{latinExtA-10A, field = {Ċ}, }
+@Type{latinExtA-10B, field = {ċ}, }
+@Type{latinExtA-10C, field = {Č}, }
+@Type{latinExtA-10D, field = {č}, }
+@Type{latinExtA-10E, field = {Ď}, }
+@Type{latinExtA-10F, field = {ď}, }
+@Type{latinExtA-110, field = {Đ}, }
+@Type{latinExtA-111, field = {đ}, }
+@Type{latinExtA-112, field = {Ē}, }
+@Type{latinExtA-113, field = {ē}, }
+@Type{latinExtA-114, field = {Ĕ}, }
+@Type{latinExtA-115, field = {ĕ}, }
+@Type{latinExtA-116, field = {Ė}, }
+@Type{latinExtA-117, field = {ė}, }
+@Type{latinExtA-118, field = {Ę}, }
+@Type{latinExtA-119, field = {ę}, }
+@Type{latinExtA-11A, field = {Ě}, }
+@Type{latinExtA-11B, field = {ě}, }
+@Type{latinExtA-11C, field = {Ĝ}, }
+@Type{latinExtA-11D, field = {ĝ}, }
+@Type{latinExtA-11E, field = {Ğ}, }
+@Type{latinExtA-11F, field = {ğ}, }
+@Type{latinExtA-120, field = {Ġ}, }
+@Type{latinExtA-121, field = {ġ}, }
+@Type{latinExtA-122, field = {Ģ}, }
+@Type{latinExtA-123, field = {ģ}, }
+@Type{latinExtA-124, field = {Ĥ}, }
+@Type{latinExtA-125, field = {ĥ}, }
+@Type{latinExtA-126, field = {Ħ}, }
+@Type{latinExtA-127, field = {ħ}, }
+@Type{latinExtA-128, field = {Ĩ}, }
+@Type{latinExtA-129, field = {ĩ}, }
+@Type{latinExtA-12A, field = {Ī}, }
+@Type{latinExtA-12B, field = {ī}, }
+@Type{latinExtA-12C, field = {Ĭ}, }
+@Type{latinExtA-12D, field = {ĭ}, }
+@Type{latinExtA-12E, field = {Į}, }
+@Type{latinExtA-12F, field = {į}, }
+@Type{latinExtA-130, field = {İ}, }
+@Type{latinExtA-131, field = {ı}, }
+@Type{latinExtA-132, field = {IJ}, }
+@Type{latinExtA-133, field = {ij}, }
+@Type{latinExtA-134, field = {Ĵ}, }
+@Type{latinExtA-135, field = {ĵ}, }
+@Type{latinExtA-136, field = {Ķ}, }
+@Type{latinExtA-137, field = {ķ}, }
+@Type{latinExtA-138, field = {ĸ}, }
+@Type{latinExtA-139, field = {Ĺ}, }
+@Type{latinExtA-13A, field = {ĺ}, }
+@Type{latinExtA-13B, field = {Ļ}, }
+@Type{latinExtA-13C, field = {ļ}, }
+@Type{latinExtA-13D, field = {Ľ}, }
+@Type{latinExtA-13E, field = {ľ}, }
+@Type{latinExtA-13F, field = {Ŀ}, }
+@Type{latinExtA-140, field = {ŀ}, }
+@Type{latinExtA-141, field = {Ł}, }
+@Type{latinExtA-142, field = {ł}, }
+@Type{latinExtA-143, field = {Ń}, }
+@Type{latinExtA-144, field = {ń}, }
+@Type{latinExtA-145, field = {Ņ}, }
+@Type{latinExtA-146, field = {ņ}, }
+@Type{latinExtA-147, field = {Ň}, }
+@Type{latinExtA-148, field = {ň}, }
+@Type{latinExtA-149, field = {ʼn}, }
+@Type{latinExtA-14A, field = {Ŋ}, }
+@Type{latinExtA-14B, field = {ŋ}, }
+@Type{latinExtA-14C, field = {Ō}, }
+@Type{latinExtA-14D, field = {ō}, }
+@Type{latinExtA-14E, field = {Ŏ}, }
+@Type{latinExtA-14F, field = {ŏ}, }
+@Type{latinExtA-150, field = {Ő}, }
+@Type{latinExtA-151, field = {ő}, }
+@Type{latinExtA-152, field = {Œ}, }
+@Type{latinExtA-153, field = {œ}, }
+@Type{latinExtA-154, field = {Ŕ}, }
+@Type{latinExtA-155, field = {ŕ}, }
+@Type{latinExtA-156, field = {Ŗ}, }
+@Type{latinExtA-157, field = {ŗ}, }
+@Type{latinExtA-158, field = {Ř}, }
+@Type{latinExtA-159, field = {ř}, }
+@Type{latinExtA-15A, field = {Ś}, }
+@Type{latinExtA-15B, field = {ś}, }
+@Type{latinExtA-15C, field = {Ŝ}, }
+@Type{latinExtA-15D, field = {ŝ}, }
+@Type{latinExtA-15E, field = {Ş}, }
+@Type{latinExtA-15F, field = {ş}, }
+@Type{latinExtA-160, field = {Š}, }
+@Type{latinExtA-161, field = {š}, }
+@Type{latinExtA-162, field = {Ţ}, }
+@Type{latinExtA-163, field = {ţ}, }
+@Type{latinExtA-164, field = {Ť}, }
+@Type{latinExtA-165, field = {ť}, }
+@Type{latinExtA-166, field = {Ŧ}, }
+@Type{latinExtA-167, field = {ŧ}, }
+@Type{latinExtA-168, field = {Ũ}, }
+@Type{latinExtA-169, field = {ũ}, }
+@Type{latinExtA-16A, field = {Ū}, }
+@Type{latinExtA-16B, field = {ū}, }
+@Type{latinExtA-16C, field = {Ŭ}, }
+@Type{latinExtA-16D, field = {ŭ}, }
+@Type{latinExtA-16E, field = {Ů}, }
+@Type{latinExtA-16F, field = {ů}, }
+@Type{latinExtA-170, field = {Ű}, }
+@Type{latinExtA-171, field = {ű}, }
+@Type{latinExtA-172, field = {Ų}, }
+@Type{latinExtA-173, field = {ų}, }
+@Type{latinExtA-174, field = {Ŵ}, }
+@Type{latinExtA-175, field = {ŵ}, }
+@Type{latinExtA-176, field = {Ŷ}, }
+@Type{latinExtA-177, field = {ŷ}, }
+@Type{latinExtA-178, field = {Ÿ}, }
+@Type{latinExtA-179, field = {Ź}, }
+@Type{latinExtA-17A, field = {ź}, }
+@Type{latinExtA-17B, field = {Ż}, }
+@Type{latinExtA-17C, field = {ż}, }
+@Type{latinExtA-17D, field = {Ž}, }
+@Type{latinExtA-17E, field = {ž}, }
+@Type{latinExtA-17F, field = {ſ}, }
+
+@Type{fullw-001, field = {#}, }
+@Type{fullw-002, field = {@}, }
+@Type{fullw-003, field = {A}, }
+@Type{fullw-004, field = {z}, }
+@Type{fullw-005, field = {£}, }
+@Type{fullw-006, field = {₩}, }
+
+@Type{kana-101, field = {ア}, }
+@Type{kana-102, field = {イ}, }
+@Type{kana-103, field = {ウ}, }
+@Type{kana-105, field = {ワ}, }
+@Type{kana-106, field = {ヲ}, }
+@Type{kana-107, field = {ン}, }
+
+@Type{symbol-101, field = {☀}, }
+@Type{symbol-102, field = {☁}, }
+@Type{symbol-103, field = {☂}, }
+@Type{symbol-104, field = {☃}, }
+@Type{symbol-105, field = {●}, }
+@Type{symbol-106, field = {△}, }
+@Type{symbol-107, field = {■}, }
+@Type{symbol-108, field = {◇}, }
+
+@Type{ascii-long-100, field = {L LONG long LONG long LONG long LONG long LONG long LONG long LONG long LONG long}, }
+@Type{ascii-long-101, field = {L LONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlong LONG long}, }
+@Type{ascii-long-102, field = {L LONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONG{long} LONG long}, }
+@Type{ascii-long-103, field = {L LONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlong\\ LONG long}, }
+@Type{ascii-long-104, field = {L longlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlong LONG long}, }
+@Type{latin1-long-100, field = {L ÅÇÐÈ îøüý ÅÇÐÈ îøüý ÅÇÐÈ îøüý ÅÇÐÈ îøüý ÅÇÐÈ îøüý ÅÇÐÈ îøüý ÅÇÐÈ îøüý}, }
+@Type{latin1-long-101, field = {L ÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüý ÅÇÐÈ îøüý}, }
+@Type{latin1-long-102, field = {L ÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈ{îøüý} ÅÇÐÈ îøüý}, }
+@Type{latin1-long-103, field = {L ÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüý\\ ÅÇÐÈ îøüý}, }
+@Type{latin1-long-104, field = {L ÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈiouý ÅÇÐÈ îøüý}, }
+@Type{latin1-long-105, field = {L ÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈiouy ÅÇÐÈ îøüý}, }
+@Type{latinEA-long-100, field = {L ĂĆĎĘ ĭőůŷ ĂĆĎĘ ĭőůŷ ĂĆĎĘ ĭőůŷ ĂĆĎĘ ĭőůŷ ĂĆĎĘ ĭőůŷ ĂĆĎĘ ĭőůŷ ĂĆĎĘ ĭőůŷ}, }
+@Type{latinEA-long-101, field = {L ĂĆĎĘĭőůŷĂĆĎĘĭőůŷĂĆĎĘĭőůŷĂĆĎĘĭőůŷĂĆĎĘĭőůŷĂĆĎĘĭőůŷĂĆĎĘĭőůŷ ĂĆĎĘ ĭőůŷ}, }
+@Type{greek-long-100, field = {L ΑΒΓΔ φχψω ΑΒΓΔ φχψω ΑΒΓΔ φχψω ΑΒΓΔ φχψω ΑΒΓΔ φχψω ΑΒΓΔ φχψω ΑΒΓΔ φχψω}, }
+@Type{greek-long-101, field = {L ΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψω ΑΒΓΔ φχψω}, }
+@Type{greek-long-102, field = {L ΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔ{φχψω} ΑΒΓΔ φχψω}, }
+@Type{greek-long-103, field = {L ΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψω\\ ΑΒΓΔ φχψω}, }
+@Type{greek-long-104, field = {L ΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔiouΓ ABCD φχψω}, }
+@Type{cyrillic-long-100,field = {L АБВГ ьэюя АБВГ ьэюя АБВГ ьэюя АБВГ ьэюя АБВГ ьэюя АБВГ ьэюя АБВГ ьэюя}, }
+@Type{cyrillic-long-101,field = {L АБВГьэюяАБВГьэюяАБВГьэюяАБВГьэюяАБВГьэюяАБВГьэюяАБВГьэюя АБВГ ьэюя}, }
+@Type{hanzi-long-100, field = {L 一二三 捌玖拾 一二三 捌玖拾 一二三 捌玖拾 一二三 捌玖拾 一二三 捌玖拾 一二三 捌玖拾 一二三 捌玖拾}, }
+@Type{hanzi-long-101, field = {L 一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾 一二三 捌玖拾}, }
+@Type{hanzi-long-102, field = {L 一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三{捌玖拾} 一二三 捌玖拾}, }
+@Type{hanzi-long-103, field = {L 一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾\\ 一二三 捌玖拾}, }
+@Type{hanzi-long-200, field = {L 冤𦥑𠮟 𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱}, }
+@Type{hanzi-long-201, field = {L 冤𦥑𠮟𠀋𡈽𥝱冤𦥑𠮟𠀋𡈽𥝱冤𦥑𠮟𠀋𡈽𥝱冤𦥑𠮟𠀋𡈽𥝱冤𦥑𠮟𠀋𡈽𥝱冤𦥑𠮟𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱}, }
+@Type{hagul-long-100, field = {L 가나다 한글텍 가나다 한글텍 가나다 한글텍 가나다 한글텍 가나다 한글텍 가나다 한글텍 가나다 한글텍}, }
+@Type{hagul-long-101, field = {L 가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다한글텍 가나다 한글텍}, }
+@Type{hagul-long-102, field = {L 가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다{한글텍} 가나다 한글텍}, }
+@Type{hagul-long-103, field = {L 가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다한글텍\\ 가나다 한글텍}, }
diff --git a/biblio/bibtex/bibtex-x/tests/txtprfxa.aux b/biblio/bibtex/bibtex-x/tests/txtprfxa.aux
new file mode 100644
index 0000000000..bb22850114
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/txtprfxa.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testtxtprfx}
+\bibdata{testsubstra}
diff --git a/biblio/bibtex/bibtex-x/tests/txtprfxa.bbl b/biblio/bibtex/bibtex-x/tests/txtprfxa.bbl
new file mode 100644
index 0000000000..ac48144769
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/txtprfxa.bbl
@@ -0,0 +1,58 @@
+\section*{Test result}
+\begin{itemize}
+\item[orig] ABCDEFG tuvwxyz
+\item[len] 15
+\item[1] A
+\item[2] AB
+\item[3] ABC
+\item[4] ABCD
+\item[5] ABCDE
+\item[6] ABCDEF
+\item[7] ABCDEFG
+\item[orig] ~
+\item[len] 15
+\item[1]
+\item[2]
+\item[3]
+\item[4]
+\item[5]
+\item[6]
+\item[7]
+\item[orig] {AB}CDEFG tuvwx{yz}
+\item[len] 15
+\item[1] {A}
+\item[2] {AB}
+\item[3] {AB}C
+\item[4] {AB}CD
+\item[5] {AB}CDE
+\item[6] {AB}CDEF
+\item[7] {AB}CDEFG
+\item[orig] {{AB}CD}EFG tuv{wx{yz}}
+\item[len] 15
+\item[1] {{A}}
+\item[2] {{AB}}
+\item[3] {{AB}C}
+\item[4] {{AB}CD}
+\item[5] {{AB}CD}E
+\item[6] {{AB}CD}EF
+\item[7] {{AB}CD}EFG
+\item[orig] {{}}~{{}}
+\item[len] 15
+\item[1] {{}}
+\item[2] {{}}
+\item[3] {{}}
+\item[4] {{}}
+\item[5] {{}}
+\item[6] {{}}
+\item[7] {{}}
+\item[orig] {\a}{\b}{\c}
+\item[len] 9
+\item[1] {\a}
+\item[2] {\a}
+\item[3] {\a}
+\item[4] {\a}{\b}
+\item[5] {\a}{\b}
+\item[6] {\a}{\b}
+\item[7] {\a}{\b}{\c}
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/txtprfxu.aux b/biblio/bibtex/bibtex-x/tests/txtprfxu.aux
new file mode 100644
index 0000000000..8b09ddcead
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/txtprfxu.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testtxtprfx}
+\bibdata{testsubstru}
diff --git a/biblio/bibtex/bibtex-x/tests/txtprfxu.bbl b/biblio/bibtex/bibtex-x/tests/txtprfxu.bbl
new file mode 100644
index 0000000000..59e7b22261
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/txtprfxu.bbl
@@ -0,0 +1,149 @@
+\section*{Test result}
+\begin{itemize}
+\item[orig] ABCDEFG tuvwxyz
+\item[len] 15
+\item[1] A
+\item[2] AB
+\item[3] ABC
+\item[4] ABCD
+\item[5] ABCDE
+\item[6] ABCDEF
+\item[7] ABCDEFG
+\item[orig] ÅÇÈÎØÜÝ~åçèîøüý
+\item[len] 15
+\item[1] Å
+\item[2] ÅÇ
+\item[3] ÅÇÈ
+\item[4] ÅÇÈÎ
+\item[5] ÅÇÈÎØ
+\item[6] ÅÇÈÎØÜ
+\item[7] ÅÇÈÎØÜÝ
+\item[orig] AÇう冤EÜЖ~tçユ漆𡚴xюω
+\item[len] 16
+\item[1] A
+\item[2] AÇ
+\item[3] AÇう
+\item[4] AÇう冤
+\item[5] AÇう冤E
+\item[6] AÇう冤EÜ
+\item[7] AÇう冤EÜЖ
+\item[orig] {AB}CDEFG tuvwx{yz}
+\item[len] 15
+\item[1] {A}
+\item[2] {AB}
+\item[3] {AB}C
+\item[4] {AB}CD
+\item[5] {AB}CDE
+\item[6] {AB}CDEF
+\item[7] {AB}CDEFG
+\item[orig] {\a}Åå{\b}Ææ{\c}Çç
+\item[len] 9
+\item[1] {\a}
+\item[2] {\a}Å
+\item[3] {\a}Åå
+\item[4] {\a}Åå{\b}
+\item[5] {\a}Åå{\b}Æ
+\item[6] {\a}Åå{\b}Ææ
+\item[7] {\a}Åå{\b}Ææ{\c}
+\item[orig] {\a}αあ{\b}βい{\c}γう
+\item[len] 9
+\item[1] {\a}
+\item[2] {\a}α
+\item[3] {\a}αあ
+\item[4] {\a}αあ{\b}
+\item[5] {\a}αあ{\b}β
+\item[6] {\a}αあ{\b}βい
+\item[7] {\a}αあ{\b}βい{\c}
+\item[orig] {\a}あα{\b}いβ{\c}うγ
+\item[len] 9
+\item[1] {\a}
+\item[2] {\a}あ
+\item[3] {\a}あα
+\item[4] {\a}あα{\b}
+\item[5] {\a}あα{\b}い
+\item[6] {\a}あα{\b}いβ
+\item[7] {\a}あα{\b}いβ{\c}
+\item[orig] {{AB}CD}EFG tuv{wx{yz}}
+\item[len] 15
+\item[1] {{A}}
+\item[2] {{AB}}
+\item[3] {{AB}C}
+\item[4] {{AB}CD}
+\item[5] {{AB}CD}E
+\item[6] {{AB}CD}EF
+\item[7] {{AB}CD}EFG
+\item[orig] {{ÅÇ}ÈÎ}ØÜÝ~åçè{îø{üý}}
+\item[len] 15
+\item[1] {{Å}}
+\item[2] {{ÅÇ}}
+\item[3] {{ÅÇ}È}
+\item[4] {{ÅÇ}ÈÎ}
+\item[5] {{ÅÇ}ÈÎ}Ø
+\item[6] {{ÅÇ}ÈÎ}ØÜ
+\item[7] {{ÅÇ}ÈÎ}ØÜÝ
+\item[orig] {{一二}三四}五六七 肆伍陸{漆捌{玖拾}}
+\item[len] 15
+\item[1] {{一}}
+\item[2] {{一二}}
+\item[3] {{一二}三}
+\item[4] {{一二}三四}
+\item[5] {{一二}三四}五
+\item[6] {{一二}三四}五六
+\item[7] {{一二}三四}五六七
+\item[orig]
+ {{櫛杓}屠冤}𦥑𠮟𠀋𡈽𥝱𨦇𡚴{𠷡𧘕{𧘔𩸽}}
+\item[len] 15
+\item[1] {{櫛}}
+\item[2] {{櫛杓}}
+\item[3] {{櫛杓}屠}
+\item[4] {{櫛杓}屠冤}
+\item[5] {{櫛杓}屠冤}𦥑
+\item[6] {{櫛杓}屠冤}𦥑𠮟
+\item[7] {{櫛杓}屠冤}𦥑𠮟𠀋
+\item[orig] ΑΒΓΔΕΖΗ στυφχψω
+\item[len] 15
+\item[1] Α
+\item[2] ΑΒ
+\item[3] ΑΒΓ
+\item[4] ΑΒΓΔ
+\item[5] ΑΒΓΔΕ
+\item[6] ΑΒΓΔΕΖ
+\item[7] ΑΒΓΔΕΖΗ
+\item[orig] АБВГДЕЖ щъыьэюя
+\item[len] 15
+\item[1] А
+\item[2] АБ
+\item[3] АБВ
+\item[4] АБВГ
+\item[5] АБВГД
+\item[6] АБВГДЕ
+\item[7] АБВГДЕЖ
+\item[orig] あいうえおかき ユヨワヰヱヲン
+\item[len] 15
+\item[1] あ
+\item[2] あい
+\item[3] あいう
+\item[4] あいうえ
+\item[5] あいうえお
+\item[6] あいうえおか
+\item[7] あいうえおかき
+\item[orig] 一二三四五六七 肆伍陸漆捌玖拾
+\item[len] 15
+\item[1] 一
+\item[2] 一二
+\item[3] 一二三
+\item[4] 一二三四
+\item[5] 一二三四五
+\item[6] 一二三四五六
+\item[7] 一二三四五六七
+\item[orig] 櫛杓屠冤𦥑𠮟𠀋𡈽𥝱𨦇𡚴𠷡𧘕𧘔𩸽
+\item[len] 15
+\item[1] 櫛
+\item[2] 櫛杓
+\item[3] 櫛杓屠
+\item[4] 櫛杓屠冤
+\item[5] 櫛杓屠冤𦥑
+\item[6] 櫛杓屠冤𦥑𠮟
+\item[7] 櫛杓屠冤𦥑𠮟𠀋
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/ubasic.aux b/biblio/bibtex/bibtex-x/tests/ubasic.aux
new file mode 100644
index 0000000000..4795668d63
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/ubasic.aux
@@ -0,0 +1,6 @@
+\relax
+\citation{li2018fuzzing}
+\bibstyle{plain}
+\bibdata{ubasic}
+\@writefile{toc}{\contentsline {section}{\numberline {1}Test}{1}{}\protected@file@percent }
+\gdef \@abspage@last{1}
diff --git a/biblio/bibtex/bibtex-x/tests/ubasic.bbl b/biblio/bibtex/bibtex-x/tests/ubasic.bbl
new file mode 100644
index 0000000000..ead61e2719
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/ubasic.bbl
@@ -0,0 +1,8 @@
+\begin{thebibliography}{1}
+
+\bibitem{li2018fuzzing}
+Jun Li, Bodong Zhao, and Chao Zhang.
+\newblock Fuzzing: a {Survey} abc def.
+\newblock {\em Cybersecurity}, 1(1):6, 2018.
+
+\end{thebibliography}
diff --git a/biblio/bibtex/bibtex-x/tests/ubasic.bib b/biblio/bibtex/bibtex-x/tests/ubasic.bib
new file mode 100644
index 0000000000..67383f2e26
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/ubasic.bib
@@ -0,0 +1,13 @@
+% $Id: ubasic.bib 60292 2021-08-21 09:09:30Z takuji $
+% Public domain. Submitted by Dmitry Zheleznyakov, 2021.
+
+@article{li2018fuzzing,
+ title={Fuzzing: a {Survey} ABC Def},
+ author={Li, Jun and Zhao, Bodong and Zhang, Chao},
+ journal={Cybersecurity},
+ volume={1},
+ number={1},
+ pages={6},
+ year={2018},
+ publisher={Springer}
+}
diff --git a/biblio/bibtex/bibtex-x/tests/ubasic.tex b/biblio/bibtex/bibtex-x/tests/ubasic.tex
new file mode 100644
index 0000000000..1012f2b42d
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/ubasic.tex
@@ -0,0 +1,15 @@
+% $Id: ubasic.tex 59662 2021-06-20 22:56:11Z karl $
+% Public domain. Submitted by Dmitry Zheleznyakov, 2021.
+
+\documentclass{article}
+\usepackage[utf8]{inputenc}
+
+\begin{document}
+
+\section{Test}
+Test~\cite{li2018fuzzing}.
+
+\bibliographystyle{plain}
+\bibliography{ubasic}
+
+\end{document}
diff --git a/biblio/bibtex/bibtex-x/tests/urange.aux b/biblio/bibtex/bibtex-x/tests/urange.aux
new file mode 100644
index 0000000000..30a3a58eba
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/urange.aux
@@ -0,0 +1,6 @@
+\relax
+\citation{li2018range}
+\bibstyle{plain}
+\bibdata{urange}
+\@writefile{toc}{\contentsline {section}{\numberline {1}Test}{1}{}\protected@file@percent }
+\gdef \@abspage@last{1}
diff --git a/biblio/bibtex/bibtex-x/tests/urange.bbl b/biblio/bibtex/bibtex-x/tests/urange.bbl
new file mode 100644
index 0000000000..8a37988ef2
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/urange.bbl
@@ -0,0 +1,8 @@
+\begin{thebibliography}{1}
+
+\bibitem{li2018range}
+Jun Li, Bodong Zhao, and Chao Zhang.
+\newblock Fuzzing: a survey.
+\newblock {\em Cybersecurity}, 1(1):3--6, 2018.
+
+\end{thebibliography}
diff --git a/biblio/bibtex/bibtex-x/tests/urange.bib b/biblio/bibtex/bibtex-x/tests/urange.bib
new file mode 100644
index 0000000000..2f7bbccfe5
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/urange.bib
@@ -0,0 +1,13 @@
+% $Id: urange.bib 59662 2021-06-20 22:56:11Z karl $
+% Public domain. Submitted by Dmitry Zheleznyakov, 2021.
+
+@article{li2018range,
+ title={Fuzzing: a survey},
+ author={Li, Jun and Zhao, Bodong and Zhang, Chao},
+ journal={Cybersecurity},
+ volume={1},
+ number={1},
+ pages={3--6},
+ year={2018},
+ publisher={Springer}
+}
diff --git a/biblio/bibtex/bibtex-x/tests/urange.tex b/biblio/bibtex/bibtex-x/tests/urange.tex
new file mode 100644
index 0000000000..239f2c251f
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/urange.tex
@@ -0,0 +1,15 @@
+% $Id: urange.tex 59662 2021-06-20 22:56:11Z karl $
+% Public domain. Submitted by Dmitry Zheleznyakov, 2021.
+
+\documentclass{article}
+\usepackage[utf8]{inputenc}
+
+\begin{document}
+
+\section{Test}
+Test~\cite{li2018range}.
+
+\bibliographystyle{plain}
+\bibliography{urange}
+
+\end{document}
diff --git a/biblio/bibtex/bibtex-x/tests/widtha.aux b/biblio/bibtex/bibtex-x/tests/widtha.aux
new file mode 100644
index 0000000000..745b8adc93
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/widtha.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testwidth}
+\bibdata{testwidtha}
diff --git a/biblio/bibtex/bibtex-x/tests/widtha.bbl b/biblio/bibtex/bibtex-x/tests/widtha.bbl
new file mode 100644
index 0000000000..b4714f5fdb
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/widtha.bbl
@@ -0,0 +1,158 @@
+\section*{Test result}
+\begin{itemize}
+\item 500 0
+\item 500 1
+\item 500 2
+\item 500 3
+\item 500 4
+\item 500 5
+\item 500 6
+\item 500 7
+\item 500 8
+\item 500 9
+\item 750 A
+\item 5057 ACDE iouy
+\item 750
+\item 750
+\item 750
+\item 750
+\item 750
+\item 750
+\item 903
+\item 5057
+\item 37067
+
+\item 38788
+\item 500 a
+\item 500
+\item 500
+\item 500
+\item 500
+\item 500
+\item 500
+\item 722
+\item 708 B
+\item 556 b
+\item 722 C
+\item 722
+\item 444 c
+\item 444
+\item 764 D
+\item 764
+\item 556 d
+\item 500
+\item 681 E
+\item 681
+\item 681
+\item 681
+\item 681
+\item 444 e
+\item 444
+\item 444
+\item 444
+\item 444
+\item 653 F
+\item 306 f
+\item 785 G
+\item 500 g
+\item 750 H
+\item 556 h
+\item 361 I
+\item 361
+\item 361
+\item 361
+\item 361
+\item 278 i
+\item 278
+\item 278
+\item 278
+\item 333
+\item 514 J
+\item 306 j
+\item 778 K
+\item 528 k
+\item 625 L
+\item 42346 LONG long LONG long LONG long LONG long LONG long LONG long LONG
+ long LONG long
+\item 43504 LONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlong
+ LONG long
+\item 278 l
+\item 917 M
+\item 833 m
+\item 750 N
+\item 750
+\item 556 n
+\item 556
+\item 778 O
+\item 778
+\item 778
+\item 778
+\item 778
+\item 778
+\item 778
+\item 500 o
+\item 500
+\item 500
+\item 500
+\item 500
+\item 500
+\item 500
+\item 681 P
+\item 556 p
+\item 778 Q
+\item 528 q
+\item 736 R
+\item 392 r
+\item 556 S
+\item 394 s
+\item 500
+\item 722 T
+\item 625
+\item 389 t
+\item 556
+\item 750 U
+\item 750
+\item 750
+\item 750
+\item 750
+\item 556 u
+\item 556
+\item 556
+\item 556
+\item 556
+\item 750 V
+\item 528 v
+\item 1028 W
+\item 722 w
+\item 750 X
+\item 528 x
+\item 750 Y
+\item 750
+\item 528 y
+\item 528
+\item 528
+\item 611 Z
+\item 444 z
+\item 278 !
+\item 500 "
+\item 833 #
+\item 500 $
+\item 833 %
+\item 778 &
+\item 500 *
+\item 778 +
+\item 472 <
+\item 778 =
+\item 472 >
+\item 472 ?
+\item 778 @
+\item 278
+\item 639
+\item 444
+\item 556
+\item 556
+\item 472
+\item 778
+\item 778
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/widthu.aux b/biblio/bibtex/bibtex-x/tests/widthu.aux
new file mode 100644
index 0000000000..02fee3bf62
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/widthu.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{testwidth}
+\bibdata{testwidthu}
diff --git a/biblio/bibtex/bibtex-x/tests/widthu.bbl b/biblio/bibtex/bibtex-x/tests/widthu.bbl
new file mode 100644
index 0000000000..d5f87de575
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/widthu.bbl
@@ -0,0 +1,417 @@
+\section*{Test result}
+\begin{itemize}
+\item 1000  
+\item 278 ¡
+\item 472 ¿
+\item 556 «
+\item 556 »
+\item 444 §
+\item 1000 @
+\item 1000 #
+\item 778 ÷
+\item 778 ×
+\item 700 ■
+\item 700 △
+\item 700 ◇
+\item 700 ●
+\item 700 ☀
+\item 700 ☁
+\item 700 ☂
+\item 700 ☃
+\item 639 £
+\item 1000 £
+\item 1000 ₩
+\item 1000 A
+\item 722 æ
+\item 903 Æ
+\item 278 !
+\item 500 "
+\item 833 #
+\item 500 $
+\item 833 %
+\item 778 &
+\item 500 *
+\item 778 +
+\item 500 0
+\item 500 1
+\item 500 2
+\item 500 3
+\item 500 4
+\item 500 5
+\item 500 6
+\item 500 7
+\item 500 8
+\item 500 9
+\item 472 <
+\item 778 =
+\item 472 >
+\item 472 ?
+\item 778 @
+\item 750 A
+\item 750 Á
+\item 750 À
+\item 750 Ă
+\item 750 Â
+\item 750 Å
+\item 750 Ä
+\item 750 Ã
+\item 750 Ą
+\item 750 Ā
+\item 5057 ACDE iouy
+\item 5057 ĂĆĎĘ ĭőůŷ
+\item 5057 ÅÇÐÈ îøüý
+\item 708 B
+\item 722 C
+\item 722 Ć
+\item 722 Ĉ
+\item 722 Č
+\item 722 Ċ
+\item 722 Ç
+\item 764 D
+\item 764 Ď
+\item 681 E
+\item 681 É
+\item 681 È
+\item 681 Ĕ
+\item 681 Ê
+\item 681 Ě
+\item 681 Ë
+\item 681 Ė
+\item 681 Ę
+\item 681 Ē
+\item 653 F
+\item 785 G
+\item 785 Ğ
+\item 785 Ĝ
+\item 785 Ġ
+\item 785 Ģ
+\item 750 H
+\item 750 Ĥ
+\item 361 I
+\item 361 Í
+\item 361 Ì
+\item 361 Ĭ
+\item 361 Î
+\item 361 Ï
+\item 361 Ĩ
+\item 361 İ
+\item 361 Į
+\item 361 Ī
+\item 514 J
+\item 541 Ĵ
+\item 778 K
+\item 778 Ķ
+\item 625 L
+\item 625 Ĺ
+\item 625 Ľ
+\item 625 Ļ
+\item 37970 L ĂĆĎĘ ĭőůŷ ĂĆĎĘ ĭőůŷ ĂĆĎĘ ĭőůŷ ĂĆĎĘ
+ ĭőůŷ ĂĆĎĘ ĭőůŷ ĂĆĎĘ ĭőůŷ ĂĆĎĘ ĭőůŷ
+\item 39691 L
+ ĂĆĎĘĭőůŷĂĆĎĘĭőůŷĂĆĎĘĭőůŷĂĆĎĘĭőůŷĂĆĎĘĭőůŷĂĆĎĘĭőůŷĂĆĎĘĭőůŷ
+ ĂĆĎĘ ĭőůŷ
+\item 37970 L ÅÇÐÈ îøüý ÅÇÐÈ îøüý ÅÇÐÈ îøüý ÅÇÐÈ
+ îøüý ÅÇÐÈ îøüý ÅÇÐÈ îøüý ÅÇÐÈ îøüý
+\item 39691 L
+ ÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈiouy
+ ÅÇÐÈ îøüý
+\item 39691 L
+ ÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈiouý
+ ÅÇÐÈ îøüý
+\item 39691 L
+ ÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüý
+ ÅÇÐÈ îøüý
+\item 40691 L
+ ÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüý\\
+ ÅÇÐÈ îøüý
+\item 40691 L
+ ÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈîøüýÅÇÐÈ{îøüý}
+ ÅÇÐÈ îøüý
+\item 43249 L LONG long LONG long LONG long LONG long LONG long LONG long LONG
+ long LONG long
+\item 44407 L LONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlong
+ LONG long
+\item 45407 L
+ LONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlong\\ LONG long
+\item 45407 L
+ LONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONG{long} LONG long
+\item 43303 L longlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlong
+ LONG long
+\item 43717 L ΑΒΓΔ φχψω ΑΒΓΔ φχψω ΑΒΓΔ φχψω ΑΒΓΔ
+ φχψω ΑΒΓΔ φχψω ΑΒΓΔ φχψω ΑΒΓΔ φχψω
+\item 45637 L
+ ΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔiouΓ
+ ABCD φχψω
+\item 47259 L
+ ΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔ{φχψω}
+ ΑΒΓΔ φχψω
+\item 46259 L
+ ΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψω
+ ΑΒΓΔ φχψω
+\item 47259 L
+ ΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψωΑΒΓΔφχψω\\
+ ΑΒΓΔ φχψω
+\item 43717 L АБВГ ьэюя АБВГ ьэюя АБВГ ьэюя АБВГ
+ ьэюя АБВГ ьэюя АБВГ ьэюя АБВГ ьэюя
+\item 46259 L
+ АБВГьэюяАБВГьэюяАБВГьэюяАБВГьэюяАБВГьэюяАБВГьэюяАБВГьэюя
+ АБВГ ьэюя
+\item 46517 L 가나다 한글텍 가나다 한글텍 가나다 한글텍
+ 가나다 한글텍 가나다 한글텍 가나다 한글텍 가나다
+ 한글텍
+\item 44459 L
+ 가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다{한글텍}
+ 가나다 한글텍
+\item 43459 L
+ 가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다한글텍
+ 가나다 한글텍
+\item 44459 L
+ 가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다한글텍가나다한글텍\\
+ 가나다 한글텍
+\item 46517 L 一二三 捌玖拾 一二三 捌玖拾 一二三 捌玖拾
+ 一二三 捌玖拾 一二三 捌玖拾 一二三 捌玖拾 一二三
+ 捌玖拾
+\item 44459 L
+ 一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三{捌玖拾}
+ 一二三 捌玖拾
+\item 43459 L
+ 一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾 一二三 捌玖拾
+\item 44459 L
+ 一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾一二三捌玖拾\\
+ 一二三 捌玖拾
+\item 46517 L 冤𦥑𠮟 𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱 冤𦥑𠮟
+ 𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱 冤𦥑𠮟
+ 𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱
+\item 43459 L
+ 冤𦥑𠮟𠀋𡈽𥝱冤𦥑𠮟𠀋𡈽𥝱冤𦥑𠮟𠀋𡈽𥝱冤𦥑𠮟𠀋𡈽𥝱冤𦥑𠮟𠀋𡈽𥝱冤𦥑𠮟𠀋𡈽𥝱 冤𦥑𠮟 𠀋𡈽𥝱
+\item 917 M
+\item 750 N
+\item 750 Ń
+\item 750 Ň
+\item 750 Ñ
+\item 750 Ņ
+\item 778 O
+\item 778 Ó
+\item 778 Ò
+\item 778 Ŏ
+\item 778 Ô
+\item 778 Ö
+\item 778 Ő
+\item 778 Õ
+\item 778 Ō
+\item 681 P
+\item 778 Q
+\item 736 R
+\item 736 Ŕ
+\item 736 Ř
+\item 736 Ŗ
+\item 556 S
+\item 556 Ś
+\item 556 Ŝ
+\item 556 Š
+\item 556 Ş
+\item 722 T
+\item 722 Ť
+\item 722 Ţ
+\item 750 U
+\item 750 Ú
+\item 750 Ù
+\item 750 Ŭ
+\item 750 Û
+\item 750 Ů
+\item 750 Ü
+\item 750 Ű
+\item 750 Ũ
+\item 750 Ų
+\item 750 Ū
+\item 750 V
+\item 1028 W
+\item 1028 Ŵ
+\item 750 X
+\item 750 Y
+\item 750 Ý
+\item 750 Ŷ
+\item 750 Ÿ
+\item 611 Z
+\item 611 Ź
+\item 611 Ž
+\item 611 Ż
+\item 500 a
+\item 500 á
+\item 500 à
+\item 500 ă
+\item 500 â
+\item 500 å
+\item 500 ä
+\item 500 ã
+\item 500 ą
+\item 500 ā
+\item 556 b
+\item 444 c
+\item 444 ć
+\item 444 ĉ
+\item 444 č
+\item 444 ċ
+\item 444 ç
+\item 556 d
+\item 556 ď
+\item 444 e
+\item 444 é
+\item 444 è
+\item 444 ĕ
+\item 444 ê
+\item 444 ě
+\item 444 ë
+\item 444 ė
+\item 444 ę
+\item 444 ē
+\item 306 f
+\item 500 g
+\item 500 ğ
+\item 500 ĝ
+\item 500 ġ
+\item 500 ģ
+\item 556 h
+\item 556 ĥ
+\item 278 i
+\item 278 í
+\item 278 ì
+\item 278 ĭ
+\item 278 î
+\item 333 ï
+\item 278 ĩ
+\item 278 į
+\item 278 ī
+\item 306 j
+\item 306 ĵ
+\item 528 k
+\item 528 ķ
+\item 278 l
+\item 278 ĺ
+\item 278 ľ
+\item 278 ļ
+\item 833 m
+\item 556 n
+\item 556 ń
+\item 556 ň
+\item 556 ñ
+\item 556 ņ
+\item 500 o
+\item 500 ó
+\item 500 ò
+\item 500 ŏ
+\item 500 ô
+\item 500 ö
+\item 500 ő
+\item 500 õ
+\item 500 ō
+\item 556 p
+\item 528 q
+\item 392 r
+\item 392 ŕ
+\item 392 ř
+\item 392 ŗ
+\item 394 s
+\item 394 ś
+\item 394 ŝ
+\item 394 š
+\item 394 ş
+\item 389 t
+\item 389 ť
+\item 389 ţ
+\item 556 u
+\item 556 ú
+\item 556 ù
+\item 556 ŭ
+\item 556 û
+\item 556 ů
+\item 556 ü
+\item 556 ű
+\item 556 ũ
+\item 556 ų
+\item 556 ū
+\item 528 v
+\item 722 w
+\item 722 ŵ
+\item 528 x
+\item 528 y
+\item 528 ý
+\item 528 ŷ
+\item 528 ÿ
+\item 444 z
+\item 444 ź
+\item 444 ž
+\item 444 ż
+\item 556 đ
+\item 764 Đ
+\item 500 ð
+\item 764 Ð
+\item 556 ħ
+\item 750 Ħ
+\item 583 ij
+\item 861 IJ
+\item 278 ı
+\item 278 ł
+\item 625 Ł
+\item 278 ŀ
+\item 625 Ŀ
+\item 556 ŋ
+\item 792 Ŋ
+\item 500 ø
+\item 778 Ø
+\item 778 œ
+\item 1014 Œ
+\item 556 ĸ
+\item 392 ſ
+\item 500 ß
+\item 389 ŧ
+\item 722 Ŧ
+\item 1000 z
+\item 556 þ
+\item 625 Þ
+\item 556 ʼn
+\item 700 Α
+\item 4478 ΑΒΓ χψω
+\item 700 Β
+\item 700 Γ
+\item 700 χ
+\item 700 ψ
+\item 700 ω
+\item 700 А
+\item 4478 АБВ эюя
+\item 700 Б
+\item 700 В
+\item 700 э
+\item 700 ю
+\item 700 я
+\item 1000 가
+\item 6000 가나다한글텍
+\item 1000 글
+\item 1000 나
+\item 1000 다
+\item 1000 텍
+\item 1000 한
+\item 1000 あ
+\item 500 ア
+\item 7000 あいう ヱヲン
+\item 1000 い
+\item 500 イ
+\item 1000 う
+\item 500 ウ
+\item 500 ワ
+\item 1000 ヱ
+\item 1000 ヲ
+\item 500 ヲ
+\item 1000 ン
+\item 500 ン
+\item 1000 一
+\item 7000 一二三 捌玖拾
+\item 1000 三
+\item 1000 二
+\item 1000 𠮟
+\item 1000 拾
+\item 1000 捌
+\item 1000 玖
+\item 1000 𥝱
+\end{itemize}
+\endinput
diff --git a/biblio/bibtex/bibtex-x/tests/yannis.aux b/biblio/bibtex/bibtex-x/tests/yannis.aux
new file mode 100644
index 0000000000..bc896a7a62
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/yannis.aux
@@ -0,0 +1,4 @@
+\relax
+\citation{*}
+\bibstyle{apalike}
+\bibdata{yannis}
diff --git a/biblio/bibtex/bibtex-x/tests/yannis.bbl b/biblio/bibtex/bibtex-x/tests/yannis.bbl
new file mode 100644
index 0000000000..ac5294fe76
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/yannis.bbl
@@ -0,0 +1,49 @@
+\begin{thebibliography}{}
+
+\bibitem[Échelon, 2009]{cle2}
+Échelon, N. (2009).
+\newblock {\em La vie est un long fleuve tranquille}.
+\newblock Les Éditions du désastre.
+
+\bibitem[Œtingen, 2009]{cle8}
+Œtingen, N. (2009).
+\newblock {\em Un livre}.
+\newblock Les Éditions du désastre.
+
+\bibitem[Tarantin, 2009]{cle4}
+Tarantin, N. (2009).
+\newblock {\em En revenant de Tarascon}.
+\newblock Les Éditions du désastre.
+
+\bibitem[Διογένης, 2009]{cle1}
+Διογένης (2009).
+\newblock {\em Μήπως εἴδατε τὸ φανάρι μου;}.
+\newblock Τὰ σοφὰ βιβλία.
+
+\bibitem[Ἕλληνας, 2009]{cle7}
+Ἕλληνας, Μ. (2009).
+\newblock {\em Τὸ καλὸ παράδειγμα}.
+\newblock Ἐκδοτικὸς οἶκος «Δὲν βαριέσαι».
+
+\bibitem[Ζαχαρόπουλος, 2009]{cle5}
+Ζαχαρόπουλος, Ζ. (2009).
+\newblock {\em Μοῦ λένε νὰ μὴν κλαίω, μὰ τί νὰ
+ κάνω, ἀφοῦ σὲ χάνω}.
+\newblock Ἐκδόσεις τῶν χαμένων ἐλπίδων.
+
+\bibitem[Достое́вский, 1880]{cle9}
+Достое́вский, Ф.~М. (1880).
+\newblock {\em Братья Карамазовы}.
+\newblock Русскій Вѣстникъ.
+
+\bibitem[天堂最新的章节表, 2009]{cle3}
+天堂最新的章节表, 格. (2009).
+\newblock {\em 製版・文書処理システム Ω}.
+\newblock Les Éditions du désastre.
+
+\bibitem[天王最新章, 2009]{cle6}
+天王最新章, 节. (2009).
+\newblock {\em 製版・文書処理システム Ω}.
+\newblock Les Éditions du désastre.
+
+\end{thebibliography}
diff --git a/biblio/bibtex/bibtex-x/tests/yannis.bib b/biblio/bibtex/bibtex-x/tests/yannis.bib
new file mode 100644
index 0000000000..4083feb3fe
--- /dev/null
+++ b/biblio/bibtex/bibtex-x/tests/yannis.bib
@@ -0,0 +1,56 @@
+% $Id: yannis.bib 63257 2022-05-08 13:25:05Z takuji $
+% Public domain. Submitted by Yannis Haralambous, 2009.
+
+@book{cle1,
+ Author = {Διογένης},
+ Publisher = {Τὰ σοφὰ βιβλία},
+ Title = {Μήπως εἴδατε τὸ φανάρι μου;},
+ Year = {2009}}
+
+@book{cle2,
+ Author = {Échelon, Nicolas},
+ Publisher = {Les Éditions du désastre},
+ Title = {La vie est un long fleuve tranquille},
+ Year = {2009}}
+
+@book{cle3,
+ Author = {天堂最新的章节表, 格的儿子},
+ Publisher = {Les Éditions du désastre},
+ Title = {製版・文書処理システム Ω},
+ Year = {2009}}
+
+@book{cle4,
+ Author = {Tarantin, Nicolas},
+ Publisher = {Les Éditions du désastre},
+ Title = {En revenant de Tarascon},
+ Year = {2009}}
+
+@book{cle5,
+ Author = {Ζαχαρόπουλος, Ζαχαρίας},
+ Publisher = {Ἐκδόσεις τῶν χαμένων ἐλπίδων},
+ Title = {Μοῦ λένε νὰ μὴν κλαίω, μὰ τί νὰ κάνω, ἀφοῦ σὲ χάνω},
+ Year = {2009}}
+
+@book{cle6,
+ Author = {天王最新章, 节列表},
+ Publisher = {Les Éditions du désastre},
+ Title = {製版・文書処理システム Ω},
+ Year = {2009}}
+
+@book{cle7,
+ Author = {Ἕλληνας, Μῆτσος},
+ Publisher = {Ἐκδοτικὸς οἶκος «Δὲν βαριέσαι»},
+ Title = {Τὸ καλὸ παράδειγμα},
+ Year = {2009}}
+
+@book{cle8,
+ Author = {Œtingen, Nicolas},
+ Publisher = {Les Éditions du désastre},
+ Title = {Un livre},
+ Year = {2009}}
+
+@book{cle9,
+ Author = {Фёдор Миха́йлович Достое́вский},
+ Publisher = {Русскій Вѣстникъ},
+ Title = {Братья Карамазовы},
+ Year = {1880}}