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

beautify stock Invalid UTF-8 byte output: use hex for printing char

parent d6def8fd
No related branches found
No related tags found
No related merge requests found
......@@ -54,11 +54,22 @@
\expandafter\UTFviii@hexnumber\expandafter{#1}%
}%
% same for bytes
\def\unicodedomino@bytehex#1{%
\expandafter\UTFviii@hexdigit\expandafter{\the\numexpr(#1-8)/16\relax}%
\UTFviii@hexdigit{\numexpr#1\ifnum#1>0-((#1-8)/16)*16\fi\relax}%
}%
% override to beautify the output, not strictly necessary but requested
\gdef\UTFviii@splitcsname#1:#2\relax{%
#2 (\expandafter\unicodedomino@codepoint\expandafter{%
\the\numexpr\decode@UTFviii#2\relax})%
}%
\def\UTFviii@invalid@err#1{%
\PackageError{inputenc}{%
Invalid UTF-8 byte 0x\unicodedomino@bytehex{\number`#1}%
}\UTFviii@invalid@help%
}%
% for invalid encoding output
\gdef\unicodedomino@splith@x#1#2\relax{%
......
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