summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2021-06-29 12:17:23 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2021-06-29 12:17:23 +0000
commit1e533cd59d86f8b4c7ec605b41498b069cc933bf (patch)
tree7725f275cd2c6ed7d67b813b0befb523b85af433 /Build
parent7bc30853dc6c5c55866c56236a9a5eb3c135e5f5 (diff)
ptexdir/tests/ucs*.tex: test files
git-svn-id: svn://tug.org/texlive/trunk@59751 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/ptexdir/tests/ucs.tex29
-rw-r--r--Build/source/texk/web2c/ptexdir/tests/ucs_toucs.tex52
2 files changed, 81 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/ptexdir/tests/ucs.tex b/Build/source/texk/web2c/ptexdir/tests/ucs.tex
new file mode 100644
index 00000000000..ed5350fd123
--- /dev/null
+++ b/Build/source/texk/web2c/ptexdir/tests/ucs.tex
@@ -0,0 +1,29 @@
+%#!eptex
+
+\def\typeout{\immediate\write17}
+
+\ifnum`あ="A4A2 \typeout{<EUC>}
+\else\ifnum`ア="8341 \typeout{<SJIS>}
+\else\typeout{<uptex>}\fi\fi
+
+\typeout{\string\ucs.}
+\newcount\cntA
+\loop\ifnum\cntA<256
+ \ifnum0=\ucs\cntA\else\typeout{\the\cntA: \ucs\cntA (\Uchar\ucs\cntA)}\fi
+ \advance\cntA1
+\repeat
+
+
+\typeout{\string\toucs.}
+\cntA=0
+\loop\ifnum\cntA<256
+ \ifnum0=\toucs\cntA\else\typeout{\the\cntA: \toucs\cntA}\fi
+ \advance\cntA1
+\repeat
+\typeout{\toucs"0, \toucs"80, \toucs"D7, \toucs"A7, \toucs"10000}
+\typeout{\toucs"8341, \toucs"EAA4, \toucs"EAA5}
+\typeout{\toucs"A4A2, \toucs"F4A6, \toucs"F4A7}
+
+
+\bye
+
diff --git a/Build/source/texk/web2c/ptexdir/tests/ucs_toucs.tex b/Build/source/texk/web2c/ptexdir/tests/ucs_toucs.tex
new file mode 100644
index 00000000000..322a1e61d11
--- /dev/null
+++ b/Build/source/texk/web2c/ptexdir/tests/ucs_toucs.tex
@@ -0,0 +1,52 @@
+%#!eptex -ini -etex
+\let\dump\relax
+\input plain
+\newlinechar=`^^J
+
+\newcount\tempcnta
+\newcount\CharCount
+
+\xdef\KINTERNAL{%
+ \ifnum\ucs"3000="3000 \string\ucs
+ \else\ifnum\euc"A1A1="A1A1 \string\euc
+ \else\ifnum\sjis"8140="8140 \string\sjis
+ \fi\fi\fi}
+
+{\escapechar-1 \xdef\CHAR{\string\char}\xdef\OMCHAR{\string\omathchar}}
+\def\CC#1{\expandafter\StripChar#1}
+\expandafter\def\expandafter\StripChar\expandafter#\expandafter1\CHAR#2{#2}
+\def\OC#1{\expandafter\StripOChar#1}
+\expandafter\def\expandafter\StripOChar\expandafter#\expandafter1\OMCHAR#2{#2}
+
+\CharCount=0\relax
+\tempcnta=0\relax
+%\ifnum\ucs"3000="3000 \else \tempcnta=256\relax \fi
+\loop\ifnum\tempcnta<"110000\relax
+ %\iffontchar\jfont\tempcnta\relax
+ \ifnum\ucs\toucs\tempcnta=\tempcnta\relax
+ \advance\CharCount by 1\relax
+\ifnum\ucs"3000="3000 \else % boring for upTeX -> omitted
+ \ifx\omathchardef\undefined %%%%%
+ \message{^^J\KINTERNAL\the\tempcnta\space
+ = \string\ucs\toucs\tempcnta}
+ \else %%%%%
+ \chardef\KnjInternal=\tempcnta\relax
+ \omathchardef\KnjUCS=\toucs\tempcnta\relax
+ \message{^^J\KINTERNAL\CC{\meaning\KnjInternal}
+ = \string\ucs\OC{\meaning\KnjUCS} (\Uchar\tempcnta)}
+ \fi %%%%%
+\fi
+ \else
+\ifnum\ucs"3000="3000 % should not happen for upTeX
+ \errhelp{}\errmessage{Should not happen: char \the\tempcnta}
+\fi
+ \fi
+ %\fi
+ \advance\tempcnta by 1\relax
+\repeat
+
+\message{^^JNumber of valid characters: \the\CharCount^^J}
+% => for pTeX, should be 6879 (JIS X 0208)
+% => for upTeX, should be 1114112 (0..0x10FFFF)
+
+\end