diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/base/utf8.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/base/utf8.def | 91 |
1 files changed, 76 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/base/utf8.def b/Master/texmf-dist/tex/latex/base/utf8.def index 1c630bd5319..715d81bceb3 100644 --- a/Master/texmf-dist/tex/latex/base/utf8.def +++ b/Master/texmf-dist/tex/latex/base/utf8.def @@ -9,11 +9,11 @@ %% This is a generated file. %% %% The source is maintained by the LaTeX Project team and bug -%% reports for it can be opened at http://latex-project.org/bugs.html +%% reports for it can be opened at https://latex-project.org/bugs.html %% (but please observe conditions on bug reports sent to that address!) %% %% -%% Copyright 1993-2016 +%% Copyright 1993-2017 %% The LaTeX3 Project and any individual authors listed elsewhere %% in this file. %% @@ -24,7 +24,7 @@ %% conditions of the LaTeX Project Public License, either version 1.3c %% of this license or (at your option) any later version. %% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt +%% https://www.latex-project.org/lppl.txt %% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. %% @@ -42,26 +42,62 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{utf8.def} - [2017/01/28 v1.1t UTF-8 support for inputenc] + [2018/04/05 v1.2c UTF-8 support for inputenc] \makeatletter \catcode`\ \saved@space@catcode -\def\UTFviii@two@octets#1#2{\expandafter +\long\def\UTFviii@two@octets#1#2{\expandafter \UTFviii@defined\csname u8:#1\string#2\endcsname} -\def\UTFviii@three@octets#1#2#3{\expandafter +\long\def\UTFviii@three@octets#1#2#3{\expandafter \UTFviii@defined\csname u8:#1\string#2\string#3\endcsname} -\def\UTFviii@four@octets#1#2#3#4{\expandafter +\long\def\UTFviii@four@octets#1#2#3#4{\expandafter \UTFviii@defined\csname u8:#1\string#2\string#3\string#4\endcsname} \def\UTFviii@defined#1{% \ifx#1\relax - \PackageError{inputenc}{Unicode\space char\space\expandafter - \UTFviii@splitcsname\string#1\relax - \MessageBreak - not\space set\space up\space - for\space use\space with\space LaTeX}\@eha + \if\relax\expandafter\UTFviii@checkseq\string#1\relax\relax + \UTFviii@undefined@err{#1}% + \else + \PackageError{inputenc}{Invalid UTF-8 byte sequence}% + \UTFviii@invalid@help + \fi \else\expandafter #1% \fi } +\def\UTFviii@invalid@err#1{% + \PackageError{inputenc}{Invalid UTF-8 byte \number`#1}% + \UTFviii@invalid@help} +\def\UTFviii@invalid@help{% + The document does not appear to be in UTF-8 encoding.\MessageBreak + Try adding \noexpand\UseRawInputEncoding as the first line of the file\MessageBreak + or specify an encoding such as \noexpand\usepackage[latin1]{inputenc}\MessageBreak + in the document preamble.\MessageBreak + Alternatively, save the file in UTF-8 using your editor or another tool} +\def\UTFviii@undefined@err#1{% + \PackageError{inputenc}{Unicode character \expandafter + \UTFviii@splitcsname\string#1\relax + \MessageBreak + not set up for use with LaTeX}% + {You may provide a definition with\MessageBreak + \noexpand\DeclareUnicodeCharacter}% + } +\def\UTFviii@checkseq#1:#2#3{% + \ifnum`#2<"80 % + \ifx\relax#3\else1\fi + \else + \ifnum`#2<"C0 % + 1 % + \else + \expandafter\expandafter\expandafter\UTFviii@check@continue + \expandafter\expandafter\expandafter#3% + \fi + \fi} +\def\UTFviii@check@continue#1{% + \ifx\relax#1% + \else + \ifnum`#1<"80 1\else\ifnum`#1>"BF 1\fi\fi + \expandafter\UTFviii@check@continue + \fi +} \begingroup \catcode`\~13 \catcode`\"12 @@ -72,6 +108,20 @@ \ifnum\count@<\@tempcnta \expandafter\UTFviii@loop \fi} + \def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@undefined@err{:\string~}}} + \count@"1 + \@tempcnta9 +\UTFviii@loop + \count@11 + \@tempcnta12 +\UTFviii@loop + \count@14 + \@tempcnta32 +\UTFviii@loop + \count@"80 + \@tempcnta"C2 + \def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@invalid@err\string~}} +\UTFviii@loop \count@"C2 \@tempcnta"E0 \def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@two@octets\string~}} @@ -84,6 +134,10 @@ \@tempcnta"F4 \def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@four@octets\string~}} \UTFviii@loop + \count@"F4 + \@tempcnta"100 + \def\UTFviii@tmp{\xdef~{\noexpand\UTFviii@invalid@err\string~}} +\UTFviii@loop \endgroup \@inpenc@test \ifx\@begindocumenthook\@undefined @@ -115,8 +169,14 @@ } \gdef\parse@XML@charref{% \ifnum\count@<"A0\relax - \PackageError{inputenc}{Cannot\space define\space Unicode\space - char\space value\space <\space 00A0}\@eha + \ifnum\catcode\count@=13 + \uccode`\~=\count@\uppercase{\def\UTFviii@tmp{\@empty\@empty~}}% + \else + \PackageError{inputenc}% + {Cannot define non-active Unicode char value < 00A0}% + \@eha + \def\UTFviii@tmp{\UTFviii@tmp}% + \fi \else\ifnum\count@<"800\relax \parse@UTFviii@a,% \parse@UTFviii@b C\UTFviii@two@octets.,% @@ -195,7 +255,7 @@ \else \gdef\UTFviii@splitcsname#1:#2\relax{% #2 (U+\expandafter\UTFviii@hexnumber\expandafter{% - \the\numexpr\decode@UTFviii#2\relax}) + \the\numexpr\decode@UTFviii#2\relax})% } \fi \endgroup @@ -248,6 +308,7 @@ \DeclareUnicodeCharacter{2026}{\textellipsis} \DeclareUnicodeCharacter{2122}{\texttrademark} \DeclareUnicodeCharacter{2423}{\textvisiblespace} +\DeclareUnicodeCharacter{FEFF}{\ifhmode\nobreak\fi} \endinput %% %% End of file `utf8.def'. |