[latex3-commits] [git/LaTeX3-latex3-latex2e] TL21-2-kernel-msgs: show invalid byte sequence in error message; change messages back to inputenc if we are before 2018 (411f7e41)

Frank Mittelbach frank.mittelbach at latex-project.org
Wed Jun 9 12:41:07 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : TL21-2-kernel-msgs
Link       : https://github.com/latex3/latex2e/commit/411f7e412c3c8ed47c0dc641eefda1c7d947a8a8

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

commit 411f7e412c3c8ed47c0dc641eefda1c7d947a8a8
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Jun 9 12:41:07 2021 +0200

    show invalid byte sequence in error message; change messages back to inputenc if we are before 2018


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

411f7e412c3c8ed47c0dc641eefda1c7d947a8a8
 base/testfiles/github-0060.tlg           |  2 +-
 base/testfiles/tlb-inputenc-001.tlg      |  2 +-
 base/testfiles/tlb-utf8-undec-cp1252.tlg |  2 +-
 base/testfiles/tlb1144.tlg               |  2 +-
 base/testfiles/tlb3480.tlg               |  6 +++---
 base/utf8ienc.dtx                        | 15 ++++++++-------
 6 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/base/testfiles/github-0060.tlg b/base/testfiles/github-0060.tlg
index 8b6d0fc0..e511304c 100644
--- a/base/testfiles/github-0060.tlg
+++ b/base/testfiles/github-0060.tlg
@@ -27,7 +27,7 @@ l. ...[^^f4^^90^^bf^^be
 You may provide a definition with
 \DeclareUnicodeCharacter 
 ===bad 2 byte
-! LaTeX Error: Invalid UTF-8 byte sequence.
+! LaTeX Error: Invalid UTF-8 byte sequence (^^dd^^dd).
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
diff --git a/base/testfiles/tlb-inputenc-001.tlg b/base/testfiles/tlb-inputenc-001.tlg
index 31ce9c35..eba03936 100644
--- a/base/testfiles/tlb-inputenc-001.tlg
+++ b/base/testfiles/tlb-inputenc-001.tlg
@@ -4,7 +4,7 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 (Font)              <7> on input line ....
 LaTeX Font Info:    External font `cmex10' loaded for size
 (Font)              <5> on input line ....
-! LaTeX Error: Invalid UTF-8 byte sequence.
+! LaTeX Error: Invalid UTF-8 byte sequence (^^c3X).
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
diff --git a/base/testfiles/tlb-utf8-undec-cp1252.tlg b/base/testfiles/tlb-utf8-undec-cp1252.tlg
index 74cac926..c54750f7 100644
--- a/base/testfiles/tlb-utf8-undec-cp1252.tlg
+++ b/base/testfiles/tlb-utf8-undec-cp1252.tlg
@@ -20,7 +20,7 @@ Try adding \UseRawInputEncoding as the first line of the file
 or specify an encoding such as \usepackage [latin1]{inputenc}
 in the document preamble.
 Alternatively, save the file in UTF-8 using your editor or another tool
-! LaTeX Error: Invalid UTF-8 byte sequence.
+! LaTeX Error: Invalid UTF-8 byte sequence (^^df\par).
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
diff --git a/base/testfiles/tlb1144.tlg b/base/testfiles/tlb1144.tlg
index 19ebc66d..467e9119 100644
--- a/base/testfiles/tlb1144.tlg
+++ b/base/testfiles/tlb1144.tlg
@@ -177,7 +177,7 @@ LaTeX Font Info:    External font `ecrm2488 at24.88pt' loaded as
 (Font)              T1/cmr/m/n/24.88  on input line ....
 LaTeX Font Info:    Switching to \T1/cmr/m/n/24.88  on input line ....
 LaTeX Font Info:    Changing size to 24.88/30.0pt on input line ....
-! LaTeX Error: Invalid UTF-8 byte sequence.
+! LaTeX Error: Invalid UTF-8 byte sequence (^^e3\par\showoutput).
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
diff --git a/base/testfiles/tlb3480.tlg b/base/testfiles/tlb3480.tlg
index c2f17764..ef75ce0e 100644
--- a/base/testfiles/tlb3480.tlg
+++ b/base/testfiles/tlb3480.tlg
@@ -6,7 +6,7 @@ File: latin1.def ....-..-.. v... Input encoding file
 LaTeX Font Info:    Trying to load font information for T1+cmtt on input line ....
 File: utf8.def ....-..-.. v... UTF-8 support
 )
-! LaTeX Error: Invalid UTF-8 byte sequence.
+! LaTeX Error: Invalid UTF-8 byte sequence (^^c3F).
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
@@ -25,7 +25,7 @@ Type  H <return>  for immediate help.
 l. ...for them: ^^c3F ^^e1^^a4^^b6
 You may provide a definition with
 \DeclareUnicodeCharacter 
-! LaTeX Error: Invalid UTF-8 byte sequence.
+! LaTeX Error: Invalid UTF-8 byte sequence (^^c3X).
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
@@ -36,7 +36,7 @@ Try adding \UseRawInputEncoding as the first line of the file
 or specify an encoding such as \usepackage [latin1]{inputenc}
 in the document preamble.
 Alternatively, save the file in UTF-8 using your editor or another tool
-! LaTeX Error: Invalid UTF-8 byte sequence.
+! LaTeX Error: Invalid UTF-8 byte sequence (^^e1XY).
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
diff --git a/base/utf8ienc.dtx b/base/utf8ienc.dtx
index c75f854b..a5174594 100644
--- a/base/utf8ienc.dtx
+++ b/base/utf8ienc.dtx
@@ -450,8 +450,9 @@
 %
 %    \begin{macrocode}
      \else
-      \@latex at error{Invalid UTF-8 byte sequence}%
-                   \UTFviii at invalid@help
+       \@latex at error{Invalid UTF-8 byte sequence (\expandafter
+                     \@gobblefour\string#1)}%
+                    \UTFviii at invalid@help
      \fi
 %    \end{macrocode}
 %
@@ -1967,7 +1968,7 @@
      \if\relax\expandafter\UTFviii at checkseq\string#1\relax\relax
       \UTFviii at undefined@err{#1}%
      \else
-      \@latex at error{Invalid UTF-8 byte sequence}%
+      \PackageError{inputenc}{Invalid UTF-8 byte sequence}%
                              \UTFviii at invalid@help
      \fi
   \else\expandafter
@@ -1975,7 +1976,7 @@
   \fi
 }
 \def\UTFviii at invalid@err#1{%
- \@latex at error{Invalid UTF-8 byte "\UTFviii at hexnumber{`#1}}%
+ \PackageError{inputenc}{Invalid UTF-8 byte "\UTFviii at hexnumber{`#1}}%
                         \UTFviii at invalid@help}
 \def\UTFviii at invalid@help{%
    The document does not appear to be in UTF-8 encoding.\MessageBreak
@@ -1984,7 +1985,7 @@
    in the document preamble.\MessageBreak
    Alternatively, save the file in UTF-8 using your editor or another tool}
 \def\UTFviii at undefined@err#1{%
-  \@latex at error{Unicode character \expandafter
+  \PackageError{inputenc}{Unicode character \expandafter
                           \UTFviii at splitcsname\string#1\relax
                           \MessageBreak
                           not set up for use with LaTeX}%
@@ -2083,7 +2084,7 @@
     \ifnum\catcode\count@=13
       \uccode`\~=\count@\uppercase{\def\UTFviii at tmp{\@empty\@empty~}}%
     \else
-      \@latex at error{Cannot define non-active Unicode char value < 00A0}%
+      \PackageError{inputenc}{Cannot define non-active Unicode char value < 00A0}%
                    \@eha
       \def\UTFviii at tmp{\UTFviii at tmp}%
     \fi
@@ -2096,7 +2097,7 @@
      \parse at UTFviii@b E\UTFviii at three@octets.{,;}%
    \else
      \ifnum\count@>"10FFFF\relax
-           \@latex at error%
+           \PackageError{inputenc}%
                 {\UTFviii at hexnumber\count@\space too large for Unicode}%
                 {Values between 0 and 10FFFF are permitted}%
       \fi





More information about the latex3-commits mailing list.