[latex3-commits] [git/LaTeX3-latex3-latex2e] master: input utf8.def not the full inputenc package (7770f9c)

David Carlisle d.p.carlisle at gmail.com
Mon Mar 26 23:07:58 CEST 2018


Repository : https://github.com/latex3/latex2e
On branch  : master
Link       : https://github.com/latex3/latex2e/commit/7770f9cda87e2e9d1a6ce8de9db3c1c798eda3fa

>---------------------------------------------------------------

commit 7770f9cda87e2e9d1a6ce8de9db3c1c798eda3fa
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Mon Mar 26 22:07:22 2018 +0100

    input utf8.def not the full inputenc package


>---------------------------------------------------------------

7770f9cda87e2e9d1a6ce8de9db3c1c798eda3fa
 base/ltfinal.dtx  |   34 +++++++++++++++++++++++++---------
 base/utf8ienc.dtx |    5 +++--
 2 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/base/ltfinal.dtx b/base/ltfinal.dtx
index 89bdfcf..62fa6ed 100644
--- a/base/ltfinal.dtx
+++ b/base/ltfinal.dtx
@@ -543,14 +543,12 @@
 %
 % \changes{v2.1a}{2018/03/25}{default to UTF-8}
 % Starting with the 2018 \LaTeX\ release default the inputencoding
-% to UTF-8. Unless the format is being used with luatex or xetex or enctex.
+% to UTF-8. Unless the format is being used with luatex, xetex, enctex or mltex.
 %
-% This is done in a way largely compatible with older releases:\\
+% This is done in a way largely compatible with older releases: |utf8.def| is input just as if\\
 % |\usepackage[utf8]{inputenc}|\\
-% is used in the format, but (similar to |fontenc|, the package load information
-% is undefined so that the encoding may be reset in the document using\\
-% |\usepackage[latin1]{inputenc}|\\
-% or whatever encoding is needed.
+% had been used, however rather than input the whole ackage a minimal core part just enough to support
+% loading the UTF-8 encoding iles is defined here.
 %
 % If a document re-specifies UTF-8 this is silently ignored.
 %
@@ -572,10 +570,27 @@
 %<latexrelease>                 {\UTFviii at invalid}{UTF-8 default}%
 %    \end{macrocode}
 %
+%
 %    \begin{macrocode}
-\RequirePackage[utf8]{inputenc}
-\expandafter\let\csname ver at inputenc.sty\endcsname\relax
-\expandafter\let\csname opt at inputenc.sty\endcsname\relax
+\def\saved at space@catcode{10}
+\let\@inpenc at test\relax
+\def\IeC{%
+  \ifx\protect\@typeset at protect
+    \expandafter\@firstofone
+  \else
+    \noexpand\IeC
+  \fi
+}
+\@tempcnta=128
+\loop
+\catcode\@tempcnta=13
+\advance\@tempcnta\@ne
+\ifnum\@tempcnta<256
+\repeat
+\edef\inputencodingname{utf8}%
+\input{utf8.def}
+\let\@inpenc at test\@undefined
+\let\saved at space@catcode\@undefined
 %</2ekernel|latexrelease>
 %<latexrelease>\EndIncludeInRelease
 %<latexrelease>\IncludeInRelease{0000/00/00}%
@@ -589,6 +604,7 @@
 %<latexrelease>\advance\@tempcnta\@ne
 %<latexrelease>\ifnum\@tempcnta<256
 %<latexrelease>\repeat
+%<latexrelease>\let\IeC\@undefined
 %<latexrelease>\def\DeclareFontEncoding@#1#2#3{%
 %<latexrelease>  \expandafter
 %<latexrelease>  \ifx\csname T@#1\endcsname\relax
diff --git a/base/utf8ienc.dtx b/base/utf8ienc.dtx
index ada847c..4bb47c4 100644
--- a/base/utf8ienc.dtx
+++ b/base/utf8ienc.dtx
@@ -218,7 +218,7 @@
 %<+ts1> \ProvidesFile{ts1enc.dfu}
 %<+x2>  \ProvidesFile{x2enc.dfu}
 %<+all> \ProvidesFile{utf8enc.dfu}
-   [2018/04/24 v1.2a UTF-8 support for inputenc]
+   [2018/03/26 v1.2b UTF-8 support for inputenc]
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -704,10 +704,11 @@
 \else
 \gdef\UTFviii at splitcsname#1:#2\relax{%
 %    \end{macrocode}
+% \changes{v1.2b}{2018/03/26}{add percent as \cs{endlinechar} not -1 in the format}%
 % Need to pre-expand the argument to ensure cleanup in case of mal-formed UTF-8.
 %    \begin{macrocode}
 #2 (U+\expandafter\UTFviii at hexnumber\expandafter{%
-                     \the\numexpr\decode at UTFviii#2\relax})
+                     \the\numexpr\decode at UTFviii#2\relax})%
 }
 \fi
 %    \end{macrocode}





More information about the latex3-commits mailing list