From a54b5d30860ad08a82b41adaa4ce3b1dfa1dd7e6 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Fri, 18 Jun 2021 20:10:06 +0000
Subject: l3 (18jun21)

git-svn-id: svn://tug.org/texlive/trunk@59627 c570f23f-e606-0410-a88d-b1316a301751
---
 .../source/latex/l3kernel/l3text-case.dtx          | 43 ++++++++++++++++------
 1 file changed, 31 insertions(+), 12 deletions(-)

(limited to 'Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx')

diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx
index 0b32e63997d..691d6a8f061 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx
@@ -43,7 +43,7 @@
 %    }^^A
 % }
 %
-% \date{Released 2021-06-01}
+% \date{Released 2021-06-18}
 %
 % \maketitle
 %
@@ -163,10 +163,15 @@
 % \begin{macro}[EXP]
 %   {\@@_change_case_char_title:nN, \@@_change_case_char_titleonly:nN}
 % \begin{macro}[EXP]{\@@_change_case_char_title:nnnN}
-% \begin{macro}[EXP]{\@@_change_case_char:nnnN, \@@_change_case_char_aux:nnnN}
+% \begin{macro}[EXP]
+%   {
+%     \@@_change_case_char:nnnN       ,
+%     \@@_change_case_char_auxi:nnnN  ,
+%     \@@_change_case_char_auxii:nnnN
+%   }
 % \begin{macro}[EXP]{\@@_change_case_char_UTFviii:nnnNN}
 % \begin{macro}[EXP]{\@@_change_case_char_UTFviii:nnnNNN}
-% \begin{macro}[EXP]{\@@_change_case_char_UTFviii:nnnNNNNN}
+% \begin{macro}[EXP]{\@@_change_case_char_UTFviii:nnnNNNN}
 % \begin{macro}[EXP]{\@@_change_case_char_UTFviii:nnnn}
 % \begin{macro}[EXP]
 %   {
@@ -608,6 +613,7 @@
 %   are to deal with. Those can then be grabbed to reconstruct the full
 %   Unicode character, which is then used in a lookup. (As will become
 %   obvious below, there is no intention here of covering all of Unicode.)
+%   For (u)p-\TeX{} there are a limited number of tokens we can touch.
 %    \begin{macrocode}
 \cs_new:Npn \@@_change_case_char:nnnN #1#2#3#4
   {
@@ -623,7 +629,7 @@
   { \sys_if_engine_luatex_p: }
   { \sys_if_engine_xetex_p: }
   {
-    \cs_new_eq:NN \@@_change_case_char_aux:nnnN
+    \cs_new_eq:NN \@@_change_case_char_auxi:nnnN
       \@@_change_case_char:nnnN
     \cs_gset:Npn \@@_change_case_char:nnnN #1#2#3#4
       {
@@ -631,20 +637,33 @@
           {
             \int_compare:nNnTF { `#4 } < { "E0 }
               { \@@_change_case_char_UTFviii:nnnNN }
-              {
-                \int_compare:nNnTF { `#4 } < { "F0 }
-                  { \@@_change_case_char_UTFviii:nnnNNN }
-                  { \@@_change_case_char_UTFviii:nnnNNNN }
-              }
-                {#1} {#2} {#3} #4
+              { \@@_change_case_char_auxii:nnnN }
           }
-          { \@@_change_case_char_aux:nnnN {#1} {#2} {#3} #4 }
+          { \@@_change_case_char_auxi:nnnN }
+            {#1} {#2} {#3} #4
        }
+    \sys_if_engine_pdftex:TF
+      {
+        \cs_new:Npn \@@_change_case_char_auxii:nnnN #1#2#3#4
+          {
+            \int_compare:nNnTF { `#4 } < { "F0 }
+              { \@@_change_case_char_UTFviii:nnnNNN }
+              { \@@_change_case_char_UTFviii:nnnNNNN }
+                {#1} {#2} {#3} #4
+          }
+      }
+      {
+        \cs_new:Npn \@@_change_case_char_auxii:nnnN #1#2#3#4
+          {
+            \@@_change_case_store:n {#4}
+            \use:c { @@_change_case_char_next_ #2 :nn } {#2} {#3}
+          }
+      }
     \cs_new:Npn \@@_change_case_char_UTFviii:nnnNN #1#2#3#4#5
       { \@@_change_case_char_UTFviii:nnnn {#1} {#2} {#3} {#4#5} }
     \cs_new:Npn \@@_change_case_char_UTFviii:nnnNNN #1#2#3#4#5#6
       { \@@_change_case_char_UTFviii:nnnn {#1} {#2} {#3} {#4#5#6} }
-    \cs_new:Npn \@@_change_case_char_UTFviii:nnnNNNNN #1#2#3#4#5#6#7
+    \cs_new:Npn \@@_change_case_char_UTFviii:nnnNNNN #1#2#3#4#5#6#7
       { \@@_change_case_char_UTFviii:nnnn {#1} {#2} {#3} {#4#5#6#7} }
     \cs_new:Npn \@@_change_case_char_UTFviii:nnnn #1#2#3#4
       {
-- 
cgit v1.2.3

