[latex3-commits] [latex3/latex3] main: Correct catcode of space in str convert (5ee772c4e)

github at latex-project.org github at latex-project.org
Sun Nov 26 12:28:24 CET 2023


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/5ee772c4e7bdfdc1d2d32a6ffaaa8d0a513d8bff

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

commit 5ee772c4e7bdfdc1d2d32a6ffaaa8d0a513d8bff
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Nov 26 11:28:24 2023 +0000

    Correct catcode of space in str convert


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

5ee772c4e7bdfdc1d2d32a6ffaaa8d0a513d8bff
 l3kernel/CHANGELOG.md                          |  1 +
 l3kernel/l3str-convert.dtx                     |  2 ++
 l3kernel/testfiles/m3str-convert002.luatex.tlg | 24 ++++++++++++++++++++++++
 l3kernel/testfiles/m3str-convert002.lvt        |  7 +++++++
 l3kernel/testfiles/m3str-convert002.tlg        | 18 ++++++++++++++++++
 l3kernel/testfiles/m3str-convert002.xetex.tlg  | 24 ++++++++++++++++++++++++
 6 files changed, 76 insertions(+)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 7ff601ec3..c2e133981 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -8,6 +8,7 @@ this project uses date-based 'snapshot' version identifiers.
 ## [Unreleased]
 
 ### Fixed
+- Catcode of space from `\str_set_convert:Nnnn` (issue \#1344)
 - Return truly string in `\bool_to_str:N` and `\bool_to_str:n` (issue \#1331)
 
 ## [2023-11-09]
diff --git a/l3kernel/l3str-convert.dtx b/l3kernel/l3str-convert.dtx
index 51419bd87..8d9deccbe 100644
--- a/l3kernel/l3str-convert.dtx
+++ b/l3kernel/l3str-convert.dtx
@@ -714,6 +714,8 @@
         { encode } { escape }
         \use_ii_i:nn
         \@@_convert_encode_:
+        \__kernel_tl_gset:Ne \g_@@_result_tl
+          { \tl_to_str:V \g_@@_result_tl }
     \group_end:
     #2 #3 \g_@@_result_tl
   }
diff --git a/l3kernel/testfiles/m3str-convert002.luatex.tlg b/l3kernel/testfiles/m3str-convert002.luatex.tlg
index 1090993ad..a7b108b7d 100644
--- a/l3kernel/testfiles/m3str-convert002.luatex.tlg
+++ b/l3kernel/testfiles/m3str-convert002.luatex.tlg
@@ -189,3 +189,27 @@ TEST 10: default
 ============================================================
 TRUE
 ============================================================
+============================================================
+TEST 11: Spaces
+============================================================
+! LaTeX Error: The 'native' encoding scheme does not support any escaping.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+Since native strings do not consist in bytes, none of the escaping methods
+make sense. The specified escaping, 'bytes', willbeignored.
+The token list \l_tmpa_tl contains the tokens:
+>  h (the character h)
+>  a (the character a)
+>  l (the character l)
+>  l (the character l)
+>  o (the character o)
+>    (blank space  )
+>  w (the character w)
+>  o (the character o)
+>  r (the character r)
+>  l (the character l)
+>  d (the character d).
+<recently read> }
+l. ...  }
+============================================================
diff --git a/l3kernel/testfiles/m3str-convert002.lvt b/l3kernel/testfiles/m3str-convert002.lvt
index d9b81ed69..565aa1df5 100644
--- a/l3kernel/testfiles/m3str-convert002.lvt
+++ b/l3kernel/testfiles/m3str-convert002.lvt
@@ -126,4 +126,11 @@
     \str_if_eq:onTF { \l_tmpa_tl } { FEFF0047007200FC00DF0065 }
       { \TRUE } { \ERROR }
   }  
+
+\TEST { Spaces }
+  {
+    \str_set_convert:Nnnn \l_tmpa_tl
+      { hallo~world } { utf8 } { default / bytes }
+    \tl_analysis_show:N \l_tmpa_tl
+  }  
 \END
diff --git a/l3kernel/testfiles/m3str-convert002.tlg b/l3kernel/testfiles/m3str-convert002.tlg
index 5626c1647..9a0dc03fa 100644
--- a/l3kernel/testfiles/m3str-convert002.tlg
+++ b/l3kernel/testfiles/m3str-convert002.tlg
@@ -194,3 +194,21 @@ TEST 10: default
 ============================================================
 TRUE
 ============================================================
+============================================================
+TEST 11: Spaces
+============================================================
+The token list \l_tmpa_tl contains the tokens:
+>  h (the character h)
+>  a (the character a)
+>  l (the character l)
+>  l (the character l)
+>  o (the character o)
+>    (blank space  )
+>  w (the character w)
+>  o (the character o)
+>  r (the character r)
+>  l (the character l)
+>  d (the character d).
+<recently read> }
+l. ...  }
+============================================================
diff --git a/l3kernel/testfiles/m3str-convert002.xetex.tlg b/l3kernel/testfiles/m3str-convert002.xetex.tlg
index 8bd8697fc..b432e42b7 100644
--- a/l3kernel/testfiles/m3str-convert002.xetex.tlg
+++ b/l3kernel/testfiles/m3str-convert002.xetex.tlg
@@ -188,3 +188,27 @@ TEST 10: default
 ============================================================
 TRUE
 ============================================================
+============================================================
+TEST 11: Spaces
+============================================================
+! LaTeX Error: The 'native' encoding scheme does not support any escaping.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+Since native strings do not consist in bytes, none of the escaping methods
+make sense. The specified escaping, 'bytes', willbeignored.
+The token list \l_tmpa_tl contains the tokens:
+>  h (the character h)
+>  a (the character a)
+>  l (the character l)
+>  l (the character l)
+>  o (the character o)
+>    (blank space  )
+>  w (the character w)
+>  o (the character o)
+>  r (the character r)
+>  l (the character l)
+>  d (the character d).
+<recently read> }
+l. ...  }
+============================================================





More information about the latex3-commits mailing list.