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

range-wrap DeclareUnicodeCharacter

parent 959bb99a
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,18 @@
\uppercase\expandafter{\UTFviii@tmp}%
\endgroup%
% now fixup to disallow too large definitions
\let\unicodedomino@parse@XML@charref\parse@XML@charref%
\gdef\parse@XML@charref{%
\ifnum\count@>"10FFFF\relax%
\PackageError{inputenc}{%
Cannot define Unicode char value\space%
\unicodedomino@shex\the\count@\relax\space (too large)%
}%
\fi%
\unicodedomino@parse@XML@charref%
}%
% nicer printing of codepoint hex numbers, not strictly necessary
\def\unicodedomino@codepoint#1{%
\ifnum#1>1048575%
......@@ -68,6 +80,14 @@
\UTFviii@hexdigit{\numexpr#1\ifnum#1>0-((#1-8)/16)*16\fi\relax}%
}%
% and arbitrary numbers
\def\unicodedomino@shex#1\relax{%
\ifnum#1>15 %
\expandafter\unicodedomino@shex\expandafter\the\numexpr(#1-8)/16\relax%
\fi%
\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{%
......
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