Created
June 21, 2021 10:07
-
-
Save h-kitagawa/e38ca5adebbde6951a1491c7497c9e26 to your computer and use it in GitHub Desktop.
pTeX の \euc, \kuten 等のプリミティブに変な値を与えてみる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#pushd /tmp/tlwork/texk/web2c/ | |
#make -j4 eptex && sudo cp eptex /opt/texlive/2021/bin/x86_64-linux/ | |
#popd | |
eptex -ini -etex -kanji-internal=euc -jobname=eptex-euc eptex.ini | |
eptex -ini -etex -kanji-internal=sjis -jobname=eptex-sjis eptex.ini | |
cat > test.tex << "EOF" | |
\ifnum`あ="A4A2 \def\XC{EUC:: }\else\def\XC{SJIS:: }\fi %" | |
\def\typeout#1{\immediate\write17{\XC \detokenize{#1}--> #1}} | |
\typeout{\kuten-1} | |
\typeout{\kuten0} | |
\typeout{\kuten"015F} %" 本来は不正のはずだが, | |
\typeout{\kuten"0160} %" | |
\ifnum`あ="A4A2 %" | |
\typeout{\sjis-1} % 本来は不正のはずだが. | |
\typeout{\sjis"FF} %" 本来は不正のはずだが. | |
\typeout{\sjis"8040}%" 本来は不正のはずだが. | |
\typeout{\sjis"817F}%" 本来は不正のはずだが. | |
\typeout{\sjis"81FF}%" 本来は不正のはずだが. | |
\typeout{\sjis"813F}%" 本来は不正のはずだが. | |
\typeout{\sjis"EFFC}%" 1-94-94 | |
\typeout{\sjis"EFFD}%" 本来は不正のはずだが. | |
\typeout{\sjis"F040}%" 「第2面」領域 | |
\typeout{\sjis"FFFD}%" 本来は不正のはずだが. | |
\else | |
\typeout{\euc-1} % 本来は不正のはずだが, | |
\typeout{\euc"FF} %" | |
\typeout{\euc"2422}%" 本来は不正のはずだが, | |
\typeout{\euc"A0A2}%" JIStoSJIS() で弾かれる | |
\typeout{\euc"A2A0}%" 本来は不正のはずだが, | |
\typeout{\euc"A29F}%" 本来は不正のはずだが, | |
\typeout{\euc"A2FF}%" | |
\fi | |
\bye | |
EOF | |
eptex -fmt=eptex-euc test.tex 2>/dev/null | grep '::' | |
eptex -fmt=eptex-sjis test.tex 2>/dev/null | grep "::" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
確かにそうですね。ありがとうございます。
https://github.com/texjporg/tex-jp-build/tree/kitagawa_toucs-1 で試しています。