[latex3-commits] [git/LaTeX3-latex3-latex2e] utf-8-protected: use \detokenize and \unexpanded not \string and \noexpand (b3e53d51)

David Carlisle d.p.carlisle at gmail.com
Sat Feb 19 20:28:51 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : utf-8-protected
Link       : https://github.com/latex3/latex2e/commit/b3e53d51c216c11b7ae551305bf4afae90aa0f16

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

commit b3e53d51c216c11b7ae551305bf4afae90aa0f16
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Sat Feb 19 19:28:51 2022 +0000

    use \detokenize and \unexpanded not \string and \noexpand


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

b3e53d51c216c11b7ae551305bf4afae90aa0f16
 base/utf8ienc.dtx | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/base/utf8ienc.dtx b/base/utf8ienc.dtx
index e579b9dd..99599860 100644
--- a/base/utf8ienc.dtx
+++ b/base/utf8ienc.dtx
@@ -363,11 +363,12 @@
 % \begin{macro}{\UTFviii at two@octets at noexpand}
 % \begin{macro}{\UTFviii at three@octets at noexpand}
 % \begin{macro}{\UTFviii at four@octets at noexpand}
+% \changes{v1.3a}{2022/02/19}{Use \cs{unexpanded} rather than \cs{noexpand} so only takes one expansion step}%
 %    These temporarily prevent the active chars from expanding.
 %    \begin{macrocode}
-\long\def\UTF at two@octets at noexpand#1#2{\noexpand#2\noexpand}
-\long\def\UTF at three@octets at noexpand#1#2#3{\noexpand#2\noexpand#3\noexpand}
-\long\def\UTF at four@octets at noexpand#1#2#3#4{\noexpand#2\noexpand#3\noexpand#4\noexpand}
+\long\def\UTF at two@octets at noexpand#1#2#3{\unexpanded{#2#3}}
+\long\def\UTF at three@octets at noexpand#1#2#3#4{\unexpanded{#2#3#4}}
+\long\def\UTF at four@octets at noexpand#1#2#3#4#5{\unexpanded{#2#3#4#5}}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -376,11 +377,12 @@
 % \begin{macro}{\UTFviii at two@octets at string}
 % \begin{macro}{\UTFviii at three@octets at string}
 % \begin{macro}{\UTFviii at four@octets at string}
+% \changes{v1.3a}{2022/02/19}{Use \cs{detokenize} rather than \cs{string} so only takes one expansion step}%
 %    And the same with \cs{string} for use in \cs{csname} constructions.
 %    \begin{macrocode}
-\long\def\UTF at two@octets at string#1#2{\string#2\string}
-\long\def\UTF at three@octets at string#1#2#3{\string#2\string#3\string}
-\long\def\UTF at four@octets at string#1#2#3#4{\string#2\string#3\string#4\string}
+\long\def\UTF at two@octets at string#1#2#3{\detokenize{#2#3}}
+\long\def\UTF at three@octets at string#1#2#3#4{\detokemize{#2#3#4}}
+\long\def\UTF at four@octets at string#1#2#3#4#5{\detokenize{#2#3#4#5}}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}





More information about the latex3-commits mailing list.