From 3562fc71c34e891ab593aa12331c10d90e7ac0a1 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Thu, 4 Oct 2018 18:11:55 +0200 Subject: [PATCH] move rejected into per-package namespace --- unicodedomino.sty | 13 ++++++++++++- unicodedomino_kernel_better_decode.def | 1 + unicodedomino_kernel_cosmetics.def | 17 +---------------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/unicodedomino.sty b/unicodedomino.sty index 610bb09..1836606 100644 --- a/unicodedomino.sty +++ b/unicodedomino.sty @@ -96,6 +96,17 @@ \expandafter\UTFviii@defined\csname u8:#1\endcsname% }% +% split an invalid byte sequence for error output +\gdef\unicodedomino@splitseq#1:#2\relax{% + \unicodedomino@hexseq#2\relax% +}% +\gdef\unicodedomino@hexseq#1#2\relax{% + % display first octet + \space "\UTFviii@hexbyte{`#1}% + % recursively handle remaining octets + \ifx\relax#2\relax\else\unicodedomino@hexseq#2\relax\fi% +}% + % main handler \def\UTFviii@defined#1{% \ifx#1\relax% @@ -112,7 +123,7 @@ \else% % invalid multibyte character \PackageError{inputenc}{Invalid UTF-8 byte sequence:% - \expandafter\UTFviii@splitseq\string#1\relax}% + \expandafter\unicodedomino@splitseq\string#1\relax}% \UTFviii@invalid@help \fi% \else% diff --git a/unicodedomino_kernel_better_decode.def b/unicodedomino_kernel_better_decode.def index 90d6414..c43f6a4 100644 --- a/unicodedomino_kernel_better_decode.def +++ b/unicodedomino_kernel_better_decode.def @@ -5,6 +5,7 @@ %- % Improved Unicode decoding using the fixed-up checkseq code. +%: entire file (plus UTFviii@checkseq) not submitted yet % override stock function, calling safer decode below \gdef\decode@UTFviii#1\relax{% \the\numexpr(\UTFviii@decode0:#1\relax)% diff --git a/unicodedomino_kernel_cosmetics.def b/unicodedomino_kernel_cosmetics.def index e2148c5..a5252fe 100644 --- a/unicodedomino_kernel_cosmetics.def +++ b/unicodedomino_kernel_cosmetics.def @@ -20,8 +20,7 @@ }% \fi% -%: reverted partially, override bogus definition -% format a number as Unicode codepoint hex +% override to format a hex Unicode codepoint correctly \gdef\UTFviii@hexcodepoint#1{% \ifnum#1<16 U+000% \else\ifnum#1<256 U+00% @@ -32,17 +31,3 @@ \fi\fi\fi\fi\fi% \UTFviii@hexnumber{#1}% }% - -%: https://github.com/latex3/latex2e/pull/62 (rejected) -% split an invalid byte sequence for output -\ifx\UTFviii@splitseq\@undefined% - \gdef\UTFviii@splitseq#1:#2\relax{% - \UTFviii@hexseq#2\relax% - }% - \gdef\UTFviii@hexseq#1#2\relax{% - % display first octet - \space "\UTFviii@hexbyte{`#1}% - % recursively handle remaining octets - \ifx\relax#2\relax\else\UTFviii@hexseq#2\relax\fi% - }% -\fi%