Skip to content
Snippets Groups Projects
Verified Commit 26d0352a authored by mirabilos's avatar mirabilos Committed by mirabilos
Browse files

always don’t expand in protected contexts

makes it more robust, even though it doesn’t fix listings files

also bump to 1.4
parent e2572c86
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
% makes all UTF-8 available in listings. % makes all UTF-8 available in listings.
\NeedsTeXFormat{LaTeX2e}% \NeedsTeXFormat{LaTeX2e}%
\ProvidesPackage{unicodedomino}[2018/08/05 1.4~ Domino for unknown codepoints]% \ProvidesPackage{unicodedomino}[2018/08/05 1.4 Domino for unknown codepoints]%
\makeatletter% \makeatletter%
\ifx\numexpr\@undefined% \ifx\numexpr\@undefined%
...@@ -83,11 +83,12 @@ ...@@ -83,11 +83,12 @@
% main handler % main handler
\def\UTFviii@defined#1{% \def\UTFviii@defined#1{%
\ifx#1\relax% \ifx\protect\@typeset@protect%
\if\relax\expandafter\UTFviii@checkseq\string#1\empty\relax% % not protected
% unknown character but valid codepoint \ifx#1\relax%
\ifx\protect\@typeset@protect% % unknown character
% not protected, replace by domino \if\relax\expandafter\UTFviii@checkseq\string#1\empty\relax%
% valid codepoint / multibyte sequence
\PackageWarning{inputenc}{% \PackageWarning{inputenc}{%
Unicode character \expandafter\UTFviii@splitcsname\string#1\relax\space% Unicode character \expandafter\UTFviii@splitcsname\string#1\relax\space%
not set up for use\MessageBreak with LaTeX, replacing% not set up for use\MessageBreak with LaTeX, replacing%
...@@ -96,19 +97,18 @@ ...@@ -96,19 +97,18 @@
% with the string “, replacing” added at the end % with the string “, replacing” added at the end
\expandafter\unicodedomino@domino\string#1\relax% \expandafter\unicodedomino@domino\string#1\relax%
\else% \else%
% protected, just write the original character % invalid multibyte character
\expandafter\@gobblefour\string#1% \PackageError{inputenc}{Invalid UTF-8 byte sequence:%
\expandafter\UTFviii@splitseq\string#1\relax}%
\UTFviii@invalid@help
\fi% \fi%
\else% \else%
%: https://github.com/latex3/latex2e/pull/62 % known character, expand
\PackageError{inputenc}{Invalid UTF-8 byte sequence:% \expandafter#1%
\expandafter\UTFviii@splitseq\string#1\relax}%
\UTFviii@invalid@help
\fi% \fi%
\else% \else%
% known character, expand % protected, just write the original multibyte character
%XXX perhaps do not expand it when protected? \expandafter\@gobblefour\string#1%
\expandafter#1%
\fi% \fi%
}% }%
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment