summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/base/utf8.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/base/utf8.def')
-rw-r--r--Master/texmf-dist/tex/latex/base/utf8.def25
1 files changed, 16 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/base/utf8.def b/Master/texmf-dist/tex/latex/base/utf8.def
index 715d81bceb3..c7efc7d1861 100644
--- a/Master/texmf-dist/tex/latex/base/utf8.def
+++ b/Master/texmf-dist/tex/latex/base/utf8.def
@@ -42,7 +42,7 @@
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
\ProvidesFile{utf8.def}
- [2018/04/05 v1.2c UTF-8 support for inputenc]
+ [2018/10/05 v1.2f UTF-8 support for inputenc]
\makeatletter
\catcode`\ \saved@space@catcode
\long\def\UTFviii@two@octets#1#2{\expandafter
@@ -64,7 +64,7 @@
\fi
}
\def\UTFviii@invalid@err#1{%
- \PackageError{inputenc}{Invalid UTF-8 byte \number`#1}%
+ \PackageError{inputenc}{Invalid UTF-8 byte "\UTFviii@hexnumber{`#1}}%
\UTFviii@invalid@help}
\def\UTFviii@invalid@help{%
The document does not appear to be in UTF-8 encoding.\MessageBreak
@@ -131,10 +131,10 @@
\def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@three@octets\string~}}
\UTFviii@loop
\count@"F0
- \@tempcnta"F4
+ \@tempcnta"F5
\def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@four@octets\string~}}
\UTFviii@loop
- \count@"F4
+ \count@"F5
\@tempcnta"100
\def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@invalid@err\string~}}
\UTFviii@loop
@@ -185,6 +185,11 @@
\parse@UTFviii@a,%
\parse@UTFviii@b E\UTFviii@three@octets.{,;}%
\else
+ \ifnum\count@>"10FFFF\relax
+ \PackageError{inputenc}%
+ {\UTFviii@hexnumber\count@\space too large for Unicode}%
+ {Values between 0 and 10FFFF are permitted}%
+ \fi
\parse@UTFviii@a;%
\parse@UTFviii@a,%
\parse@UTFviii@a!%
@@ -250,14 +255,16 @@
0\or1\or2\or3\or4\or5\or6\or7\or8\or9\or
A\or B\or C\or D\or E\or F\fi}
\fi
-\ifx\numexpr\@undefined
-\gdef\UTFviii@splitcsname#1:#2\relax{#2}}
-\else
+\gdef\UTFviii@hexcodepoint#1{U+%
+ \ifnum#1<16 0\fi
+ \ifnum#1<256 0\fi
+ \ifnum#1<4096 0\fi
+ \UTFviii@hexnumber{#1}%
+}%
\gdef\UTFviii@splitcsname#1:#2\relax{%
-#2 (U+\expandafter\UTFviii@hexnumber\expandafter{%
+#2 (\expandafter\UTFviii@hexcodepoint\expandafter{%
\the\numexpr\decode@UTFviii#2\relax})%
}
-\fi
\endgroup
\@onlypreamble\DeclareUnicodeCharacter
\@onlypreamble\parse@XML@charref