Skip to content

Commit

Permalink
move rejected into per-package namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mirabilos committed Oct 4, 2018
1 parent f62598b commit 3562fc7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
13 changes: 12 additions & 1 deletion unicodedomino.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand All @@ -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%
Expand Down
1 change: 1 addition & 0 deletions unicodedomino_kernel_better_decode.def
Original file line number Diff line number Diff line change
Expand Up @@ -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)%
Expand Down
17 changes: 1 addition & 16 deletions unicodedomino_kernel_cosmetics.def
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand All @@ -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%

0 comments on commit 3562fc7

Please sign in to comment.