[latex3-commits] [git/LaTeX3-latex3-latex2e] master: handle UTF8 BOM (586ad16)

David Carlisle d.p.carlisle at gmail.com
Thu Apr 5 10:14:58 CEST 2018


Repository : https://github.com/latex3/latex2e
On branch  : master
Link       : https://github.com/latex3/latex2e/commit/586ad16e852fca5cf42467a22823fe6fd4a7e316

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

commit 586ad16e852fca5cf42467a22823fe6fd4a7e316
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Thu Apr 5 09:14:58 2018 +0100

    handle UTF8 BOM


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

586ad16e852fca5cf42467a22823fe6fd4a7e316
 base/changes.txt                                        |    4 ++++
 base/testfiles/tlb-utf8-bom.lvt                         |   14 ++++++++++++++
 .../tlb4200.tlg => base/testfiles/tlb-utf8-bom.tlg      |   15 +++++++--------
 base/utf8ienc.dtx                                       |    6 +++++-
 4 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index e4b643c..1ad68b7 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -8,6 +8,10 @@ are not part of the distribution.
 # 2018-04-01 Release
 #########################
 
+2018-04-05  David Carlisle  <David.Carlisle at latex-project.org>
+
+	* utf8ienc.dtx: add BOM default definition
+
 2018-03-30  David Carlisle  <David.Carlisle at latex-project.org>
 
 	* ltfinal.dtx: add \UseRawInputEncoding and further
diff --git a/base/testfiles/tlb-utf8-bom.lvt b/base/testfiles/tlb-utf8-bom.lvt
new file mode 100644
index 0000000..d998e97
--- /dev/null
+++ b/base/testfiles/tlb-utf8-bom.lvt
@@ -0,0 +1,14 @@
+
+\csname stophere\endcsname
+\documentclass{article}
+%check a leading UTF-8 BOM causes no error
+\newcommand\stophere{here\endinput}
+\input{test2e}
+\showoutput
+\begin{document}
+
+\START
+
+\input{tlb-utf8-bom.lvt}
+
+\end{document}
diff --git a/required/tools/testfiles/tlb4200.tlg b/base/testfiles/tlb-utf8-bom.tlg
similarity index 78%
copy from required/tools/testfiles/tlb4200.tlg
copy to base/testfiles/tlb-utf8-bom.tlg
index 4c9e01e..ad1ff6c 100644
--- a/required/tools/testfiles/tlb4200.tlg
+++ b/base/testfiles/tlb-utf8-bom.tlg
@@ -1,5 +1,6 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
+(tlb-utf8-bom.lvt)
 Completed box being shipped out [1]
 \vbox(633.0+0.0)x407.0
 .\glue 16.0
@@ -12,17 +13,15 @@ Completed box being shipped out [1]
 ..\vbox(550.0+0.0)x345.0, glue set 539.94232fil
 ...\write-{}
 ...\glue(\topskip) 3.05556
-...\hbox(6.94444+1.94444)x345.0, glue set 311.37785fil
+...\hbox(6.94444+0.0)x345.0, glue set 311.63887fil
 ....\hbox(0.0+0.0)x15.0
-....\OT1/cmr/m/it/10 h
-....\OT1/cmr/m/it/10 a
-....\OT1/cmr/m/it/10 l
-....\OT1/cmr/m/it/10 f
-....\OT1/cmr/m/n/10 .
+....\OT1/cmr/m/n/10 h
+....\OT1/cmr/m/n/10 e
+....\OT1/cmr/m/n/10 r
+....\OT1/cmr/m/n/10 e
 ....\penalty 10000
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0
-...\glue -1.94444
 ...\glue 0.0 plus 1.0fil
 ...\glue 0.0
 ...\glue 0.0 plus 0.0001fil
@@ -31,4 +30,4 @@ Completed box being shipped out [1]
 ...\glue 0.0 plus 1.0fil
 ...\OT1/cmr/m/n/10 1
 ...\glue 0.0 plus 1.0fil
-(tlb4200.aux)
+(tlb-utf8-bom.aux)
diff --git a/base/utf8ienc.dtx b/base/utf8ienc.dtx
index e7f04ff..b67c936 100644
--- a/base/utf8ienc.dtx
+++ b/base/utf8ienc.dtx
@@ -217,7 +217,7 @@
 %<+ts1> \ProvidesFile{ts1enc.dfu}
 %<+x2>  \ProvidesFile{x2enc.dfu}
 %<+all> \ProvidesFile{utf8enc.dfu}
-   [2018/03/26 v1.2b UTF-8 support for inputenc]
+   [2018/04/05 v1.2c UTF-8 support for inputenc]
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -1606,6 +1606,10 @@
 %<all,t1>\DeclareUnicodeCharacter{1E20}{\@tabacckludge=G}
 %<all,t1>\DeclareUnicodeCharacter{1E21}{\@tabacckludge=g}
 %    \end{macrocode}
+% \changes{v1.2c}{2018/04/05}{Add BOM}
+%    \begin{macrocode}
+%<all,ts1,utf8>\DeclareUnicodeCharacter{FEFF}{\ifhmode\nobreak\fi}
+%    \end{macrocode}
 % 
 % \endgroup
 % \subsection{Notes}





More information about the latex3-commits mailing list