Skip to content
Snippets Groups Projects
Verified Commit 3562fc71 authored by mirabilos's avatar mirabilos Committed by mirabilos
Browse files

move rejected into per-package namespace

parent f62598bc
No related branches found
No related tags found
No related merge requests found
...@@ -96,6 +96,17 @@ ...@@ -96,6 +96,17 @@
\expandafter\UTFviii@defined\csname u8:#1\endcsname% \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 % main handler
\def\UTFviii@defined#1{% \def\UTFviii@defined#1{%
\ifx#1\relax% \ifx#1\relax%
...@@ -112,7 +123,7 @@ ...@@ -112,7 +123,7 @@
\else% \else%
% invalid multibyte character % invalid multibyte character
\PackageError{inputenc}{Invalid UTF-8 byte sequence:% \PackageError{inputenc}{Invalid UTF-8 byte sequence:%
\expandafter\UTFviii@splitseq\string#1\relax}% \expandafter\unicodedomino@splitseq\string#1\relax}%
\UTFviii@invalid@help \UTFviii@invalid@help
\fi% \fi%
\else% \else%
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
%- %-
% Improved Unicode decoding using the fixed-up checkseq code. % Improved Unicode decoding using the fixed-up checkseq code.
%: entire file (plus UTFviii@checkseq) not submitted yet
% override stock function, calling safer decode below % override stock function, calling safer decode below
\gdef\decode@UTFviii#1\relax{% \gdef\decode@UTFviii#1\relax{%
\the\numexpr(\UTFviii@decode0:#1\relax)% \the\numexpr(\UTFviii@decode0:#1\relax)%
......
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
}% }%
\fi% \fi%
%: reverted partially, override bogus definition % override to format a hex Unicode codepoint correctly
% format a number as Unicode codepoint hex
\gdef\UTFviii@hexcodepoint#1{% \gdef\UTFviii@hexcodepoint#1{%
\ifnum#1<16 U+000% \ifnum#1<16 U+000%
\else\ifnum#1<256 U+00% \else\ifnum#1<256 U+00%
...@@ -32,17 +31,3 @@ ...@@ -32,17 +31,3 @@
\fi\fi\fi\fi\fi% \fi\fi\fi\fi\fi%
\UTFviii@hexnumber{#1}% \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% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment