[latex3-commits] [git/LaTeX3-latex3-latex3] str-convert-dftl-utf8: add dflt as alias for utf8/native to str-convert (b61162b48)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Feb 3 11:44:43 CET 2021


Repository : https://github.com/latex3/latex3
On branch  : str-convert-dftl-utf8
Link       : https://github.com/latex3/latex3/commit/b61162b48e5db766d77efe0b06e2a8f0bff890d7

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

commit b61162b48e5db766d77efe0b06e2a8f0bff890d7
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Feb 3 11:44:43 2021 +0100

    add dflt as alias for utf8/native to str-convert


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

b61162b48e5db766d77efe0b06e2a8f0bff890d7
 l3kernel/CHANGELOG.md                          |  3 +++
 l3kernel/l3str-convert.dtx                     | 13 +++++++++++++
 l3kernel/testfiles/m3str-convert002.luatex.tlg |  5 +++++
 l3kernel/testfiles/m3str-convert002.lvt        |  8 ++++++++
 l3kernel/testfiles/m3str-convert002.tlg        |  5 +++++
 l3kernel/testfiles/m3str-convert002.xetex.tlg  |  5 +++++
 6 files changed, 39 insertions(+)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index ce8e2d5ab..96de942b1 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Added
+- `dflt` alias to str_convert
+
 ## [2021-02-02]
 
 ### Added
diff --git a/l3kernel/l3str-convert.dtx b/l3kernel/l3str-convert.dtx
index 52066270d..8e914c1c2 100644
--- a/l3kernel/l3str-convert.dtx
+++ b/l3kernel/l3str-convert.dtx
@@ -106,6 +106,8 @@
 %     \midrule
 %     \texttt{clist}                       & comma-list of integers \\
 %     \meta{empty}                         & native (Unicode) string \\
+%     \texttt{dflt}                        & like \texttt{utf8} with 8-bit engines,
+%                                            and like native with unicode-engines \\
 %     \bottomrule
 %   \end{tabular}
 % \end{table}
@@ -317,6 +319,17 @@
 \prop_gput:Nnn \g_@@_alias_prop { utf32le } { utf32 }
 \prop_gput:Nnn \g_@@_alias_prop { utf32be } { utf32 }
 \prop_gput:Nnn \g_@@_alias_prop { hexadecimal } { hex }
+\bool_lazy_any:nTF
+  {
+    \sys_if_engine_luatex_p:
+    \sys_if_engine_xetex_p:
+  }
+  {
+    \prop_gput:Nnn \g__str_alias_prop { dflt } {  }
+  }
+  {
+    \prop_gput:Nnn \g__str_alias_prop { dflt } { utf8 }
+  }
 %    \end{macrocode}
 % \end{variable}
 %
diff --git a/l3kernel/testfiles/m3str-convert002.luatex.tlg b/l3kernel/testfiles/m3str-convert002.luatex.tlg
index 42c66ae15..511d8fc89 100644
--- a/l3kernel/testfiles/m3str-convert002.luatex.tlg
+++ b/l3kernel/testfiles/m3str-convert002.luatex.tlg
@@ -183,3 +183,8 @@ TRUE
 TRUE
 TRUE
 ============================================================
+============================================================
+TEST 10: dflt
+============================================================
+TRUE
+============================================================
diff --git a/l3kernel/testfiles/m3str-convert002.lvt b/l3kernel/testfiles/m3str-convert002.lvt
index 036ff1e99..1200a2632 100644
--- a/l3kernel/testfiles/m3str-convert002.lvt
+++ b/l3kernel/testfiles/m3str-convert002.lvt
@@ -119,4 +119,12 @@
       { \TRUE } { \ERROR }
   }
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\TEST { dflt }
+  {
+    \str_set_convert:Nnnn \l_tmpa_tl { Grüße }
+      { dflt } { utf16/hex }
+    \str_if_eq:onTF { \l_tmpa_tl } { FEFF0047007200FC00DF0065 }
+      { \TRUE } { \ERROR }
+  }    
 \END
diff --git a/l3kernel/testfiles/m3str-convert002.tlg b/l3kernel/testfiles/m3str-convert002.tlg
index 9bb0ba629..048ae062f 100644
--- a/l3kernel/testfiles/m3str-convert002.tlg
+++ b/l3kernel/testfiles/m3str-convert002.tlg
@@ -189,3 +189,8 @@ TRUE
 TRUE
 TRUE
 ============================================================
+============================================================
+TEST 10: dflt
+============================================================
+TRUE
+============================================================
diff --git a/l3kernel/testfiles/m3str-convert002.xetex.tlg b/l3kernel/testfiles/m3str-convert002.xetex.tlg
index 42c66ae15..511d8fc89 100644
--- a/l3kernel/testfiles/m3str-convert002.xetex.tlg
+++ b/l3kernel/testfiles/m3str-convert002.xetex.tlg
@@ -183,3 +183,8 @@ TRUE
 TRUE
 TRUE
 ============================================================
+============================================================
+TEST 10: dflt
+============================================================
+TRUE
+============================================================





More information about the latex3-commits mailing list.