[latex3-commits] [git/LaTeX3-latex3-pdfresources] main: rename text_convert to string_from_unicode, adapt format names (edf6e13)

Ulrike Fischer fischer at troubleshooting-tex.de
Sun Feb 14 22:44:19 CET 2021


Repository : https://github.com/latex3/pdfresources
On branch  : main
Link       : https://github.com/latex3/pdfresources/commit/edf6e13c25ac00b67b1583065e38146e04517ede

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

commit edf6e13c25ac00b67b1583065e38146e04517ede
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun Feb 14 22:44:19 2021 +0100

    rename text_convert to string_from_unicode, adapt format names


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

edf6e13c25ac00b67b1583065e38146e04517ede
 hyperref-generic.dtx              |  40 +++++++-------
 info/todo-21-14.txt               |   2 +
 l3pdffile.dtx                     |   4 +-
 l3pdfmeta.dtx                     |   2 +-
 l3pdftools.dtx                    | 104 +++++++++++++++---------------------
 newpackages/new-attachfile.sty    |  10 ++--
 testfiles-dvips/embedfile.pvt     |   4 +-
 testfiles-dvips/infodict.pvt      |   2 +-
 testfiles-dvips/text-convert.lvt  |  51 +++++++++++++-----
 testfiles-dvips/text-convert.tlg  | 107 ++++++++------------------------------
 testfiles/embedfile.pvt           |   4 +-
 testfiles/infodict.pvt            |   2 +-
 testfiles/text-convert.luatex.tlg |  89 -------------------------------
 testfiles/text-convert.lvt        |  51 +++++++++++++-----
 testfiles/text-convert.tlg        |  99 ++++++++---------------------------
 testfiles/text-convert.xetex.tlg  |  73 --------------------------
 16 files changed, 199 insertions(+), 445 deletions(-)

diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index 72ce4d3..3c98c29 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -1261,12 +1261,12 @@
 \tl_new:N  \l_@@_text_enc_file_print_tl
 \tl_new:N  \l_@@_text_enc_para_print_tl
 
-\tl_set:Nn \l_@@_text_enc_uri_print_tl  {utf8/URIpdf-print}
-\tl_set:Nn \l_@@_text_enc_info_print_tl {utf16/hex-print}
-\tl_set:Nn \l_@@_text_enc_dest_tl       {utf8/string}
-\tl_set:Nn \l_@@_text_enc_dest_print_tl {utf8/string-print}
-\tl_set:Nn \l_@@_text_enc_file_print_tl {utf8/string-print}
-\tl_set:Nn \l_@@_text_enc_para_print_tl {utf8/string-print}
+\tl_set:Nn \l_@@_text_enc_uri_print_tl  {utf8/URI}
+\tl_set:Nn \l_@@_text_enc_info_print_tl {utf16/hex}
+\tl_set:Nn \l_@@_text_enc_dest_tl       {utf8/string-raw}
+\tl_set:Nn \l_@@_text_enc_dest_print_tl {utf8/string}
+\tl_set:Nn \l_@@_text_enc_file_print_tl {utf8/string}
+\tl_set:Nn \l_@@_text_enc_para_print_tl {utf8/string}
 %    \end{macrocode}
 % \end{variable}
 % \begin{variable}{\l_@@_dest_pdfview_tl}
@@ -1423,26 +1423,26 @@
 % \end{macro}
 % The last step converts the string to a PDF encoding. As we have at least two
 % targets (hex and literal) there is an argument. The conversion assumes
-% utf8 input, it is based on cs{pdf_text_convert:nnN} in l3pdftools.
+% utf8 input, it is based on cs{pdf_string_from_unicode:nnN} in l3pdftools.
 %
 % \#2 is str variable,
 % \#1 should be one of
 %
 % \begin{tabular}{ll}
-%  utf8/string-print   & \texttt{(lit)} (utf8/string)\\
-%  utf8/string         & \texttt{lit}   (utf8/string)\\
-%  utf8/URIpdf-print   & \texttt{(percent encoded url)}\\
-%  utf8/URIpdf         & \texttt{percent encoded url}\\
-%  utf16/hex-print     & \texttt{<HEX>} (utf16/hex)\\
-%  utf16/hex           & \texttt{HEX}   (utf16/hex)\\
-%  utf16/string_print  & \texttt{(lit)} (utf16/string)\\
-%  utf16/string-lit    & \texttt{lit}   (utf16/string)
+%  utf8/string         & \texttt{(lit)} (utf8/string)\\
+%  utf8/string-raw     & \texttt{lit}   (utf8/string)\\
+%  utf8/URI            & \texttt{(percent encoded url)}\\
+%  utf8/URI-raw         & \texttt{percent encoded url}\\
+%  utf16/hex            & \texttt{<HEX>} (utf16/hex)\\
+%  utf16/hex-raw           & \texttt{HEX}   (utf16/hex)\\
+%  utf16/string        & \texttt{(lit)} (utf16/string)\\
+%  utf16/string-raw    & \texttt{lit}   (utf16/string)
 %  \end{tabular}
-%  \begin{macro}{ \@@_text_convert:nN }
+%  \begin{macro}{ \@@_text_string_from_unicode:nN }
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_text_convert:nN #1 #2
+\cs_new_protected:Npn \@@_text_string_from_unicode:nN #1 #2
   {
-     \pdf_text_convert:nVN { #1 } #2 #2
+     \pdf_string_from_unicode:nVN { #1 } #2 #2
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1460,7 +1460,7 @@
     \hook_use:n {hyp/text/pdfstring}
     \@@_text_purify:nN  { #1 } \l_@@_text_tmpa_str
     \@@_text_cleanup:N         \l_@@_text_tmpa_str
-    \@@_text_convert:nN { #2 } \l_@@_text_tmpa_str
+    \@@_text_string_from_unicode:nN { #2 } \l_@@_text_tmpa_str
     \str_gset_eq:NN \g_@@_text_tmpa_str\l_@@_text_tmpa_str
     \group_end:
     \str_set_eq:NN #3 \g_@@_text_tmpa_str
@@ -1476,7 +1476,7 @@
 %^^A  \char_set_catcode_active:N \~
 %    \begin{macrocode}
 \cs_new_protected:Npn\Hy at pstringdef #1 #2
-  { \@@_text_pdfstring:xnN {#2} {utf8/string}#1 }
+  { \@@_text_pdfstring:xnN {#2} {utf8/string-raw}#1 }
 %    \end{macrocode}
 %
 % This is a special version for info keys:
diff --git a/info/todo-21-14.txt b/info/todo-21-14.txt
index a8c92b5..39ce187 100644
--- a/info/todo-21-14.txt
+++ b/info/todo-21-14.txt
@@ -13,8 +13,10 @@ TODO
 
 * check \__pdfdict_get_type:n (imho ok)
 
+
 Longer term
 
+* check content with depth in xform, if consistent across backends
 * consider  expansion to backend ...
 * consider warning if \pdfcatalog etc is used
 * xform
diff --git a/l3pdffile.dtx b/l3pdffile.dtx
index 9fc7b00..4219a5f 100644
--- a/l3pdffile.dtx
+++ b/l3pdffile.dtx
@@ -347,7 +347,7 @@
 % %set the relationship:
 % \pdfdict_put:nnn  {l_pdffile/FileSpec} {AFRelationship}{/Source}
 % %set the description key. The text must first be converted:
-% \pdf_text_convert:nnN {utf16/string-print}
+% \pdf_string_from_unicode:nnN {utf16/string}
 %    {this~is~an~odd~description~with~öäü}
 %    \l_tmpa_str
 % \pdfdict_put:nnx  {l_pdffile/FileSpec} {Desc}{\l_tmpa_str}
@@ -376,7 +376,7 @@
 %    \begin{macrocode}
 %<@@=pdffile>
 \cs_new_protected:Npn \@@_filename_convert_to_print:nN #1 #2
-  {\pdf_text_convert:nnN {utf16/hex-print}{#1}{#2}}
+  {\pdf_string_from_unicode:nnN {utf16/hex}{#1}{#2}}
 %    \end{macrocode}
 % \subsection{Messages}
 %    \begin{macrocode}
diff --git a/l3pdfmeta.dtx b/l3pdfmeta.dtx
index fe55e1c..1d35376 100644
--- a/l3pdfmeta.dtx
+++ b/l3pdfmeta.dtx
@@ -305,7 +305,7 @@
           { ##1 }
           \l_@@_tmpa_tl
           {
-            \pdf_text_convert:nVN {utf8/string-print}\l_@@_tmpa_tl\l_@@_tmpa_str
+            \pdf_string_from_unicode:nVN {utf8/string}\l_@@_tmpa_tl\l_@@_tmpa_str
             \pdfdict_put:nnx
               {l_pdfmeta/outputintent}{##1}{\l_@@_tmpa_str}
           }
diff --git a/l3pdftools.dtx b/l3pdftools.dtx
index a5081a2..a90999e 100644
--- a/l3pdftools.dtx
+++ b/l3pdftools.dtx
@@ -55,24 +55,6 @@
 % This module collects a number of commands of the tool type which haven't found
 % another home yet ... Probably this module will disappear again at some time.
 %
-% \begin{function}[EXP,added=2020-07-04]
-%   {\pdf_text_convert:nn}
-%  \begin{syntax}
-%   \cs{pdf_text_convert:nn}  \Arg{format}  \Arg{content}
-%  \end{syntax}
-%  This converts \meta{content} following the rules defined by \meta{format}.
-%  Non-ascii input should be utf8 encoded.
-%  Currently the following formats exist:
-%  \begin{description}
-%     \item[name] This will first expand the content with \cs{text_expand:n} and
-%      then escape it in the way needed in a PDF Name with
-%      \cs{str_convert_pdfname:e}.
-%     \item[name-print] This does the same as the \texttt{name} format, but also
-%     adds a slash before, so
-%      |\pdf_text_convert:nn{name-print}{abc}| will
-%     output \texttt{/abc}.
-%   \end{description}
-% \end{function}
 % \begin{function}[EXP,added=2021-02-14]
 %   {\pdf_name_from_unicode_e:n}
 %  \begin{syntax}
@@ -88,33 +70,33 @@
 %   will    output |/A#20B#25C#23D#E2#82#AC|}.
 % \end{function}
 % \begin{function}[added=2020-07-04]
-%   {\pdf_text_convert:nnN}
+%   {\pdf_string_from_unicode:nnN}
 %  \begin{syntax}
-%   \cs{pdf_text_convert:nnN}  \Arg{format}  \Arg{content} \Arg{tlvar}
+%   \cs{pdf_string_from_unicode:nnN}  \Arg{format}  \Arg{content} \Arg{tlvar}
 %  \end{syntax}
 %  This converts \meta{content} following the rules defined by \meta{format} and stores
 %  the result in \meta{tlvar}. The assignment is done locally.
 %  Non-ascii input should be utf8 encoded.
 %  Currently the following formats exist:
 %  \begin{description}
-%     \item[utf8/string]
+%     \item[utf8/string-raw]
 %      this converts with \cs{str_set_convert:Nnnn} into utf8/string.
-%     \item[utf8/string-print]
-%      this converts into utf8/string and add parentheses around.%
-%     \item[utf8/URIpdf]
+%     \item[utf8/string]
+%      this converts into utf8/string and adds parentheses around the result.%
+%     \item[utf8/URI-raw]
 %      this converts with \cs{str_set_convert:Nnnn} into utf8/url and
-%      then replace reserved and digits back from the percent encoding. Parentheses
+%      then replaces reserved and digits back from the percent encoding. Parentheses
 %      are escaped.
-%     \item[utf8/URIpdf-print]
-%      this converts into utf8/URIpdf  and add parentheses around.%
-%     \item[utf16/string]
+%     \item[utf8/URI]
+%      this converts into utf8/URI  and adds parentheses around the result.%
+%     \item[utf16/string-raw]
 %      this converts with \cs{str_set_convert:Nnnn} into utf16/string.
-%     \item[utf16/string-print]
-%      this converts into utf16/string and add parentheses around.
-%     \item[utf16/hex]
+%     \item[utf16/string]
+%      this converts into utf16/string and adds parentheses around the result.
+%     \item[utf16/hex-raw]
 %      this converts into utf16/hex
-%     \item[utf16/hex-print]
-%     this converts into utf16/hex and add bracket around.
+%     \item[utf16/hex]
+%     this converts into utf16/hex and adds bracket around the result.
 %   \end{description}
 % \end{function}
 %
@@ -257,7 +239,6 @@
 % The convert command must use a different value the source encoding
 % depending on the engines. Until the PR in str-convert is active we add the alias here
 % too
-% \begin{macro}{\pdf_text_convert:nnN}
 %    \begin{macrocode}
 \bool_lazy_any:nTF
   {
@@ -270,9 +251,12 @@
   {
     \prop_gput:Nnn \g__str_alias_prop { default } { utf8 }
   }
-\cs_new:Npn \pdf_text_convert:nnN #1 #2 #3
+%    \end{macrocode}
+% \begin{macro}{\pdf_string_from_unicode:nnN}
+%    \begin{macrocode}
+\cs_new:Npn \pdf_string_from_unicode:nnN #1 #2 #3
   {
-    \cs_if_exist_use:cF { @@_text_convert_#1:nN }
+    \cs_if_exist_use:cF { @@_string_from_unicode_#1:nN }
       {
         \__kernel_msg_error:nnn { pdf } { unknown-convert } {#1}
         \use_none:nn
@@ -280,23 +264,23 @@
     { #2 } #3
   }
 
-\cs_generate_variant:Nn \pdf_text_convert:nnN {nVN}
+\cs_generate_variant:Nn \pdf_string_from_unicode:nnN {nVN}
 %    \end{macrocode}
 % \end{macro}
 % Most converter are simply wrapper around the str-convert commands and so
-% use the same name.
+% use the same names, with the addition raw if no delimiters are added.
 % The exception is the one for url's: it reverts most of the percent encodings
 % and escapes the parentheses.
-% That's why its name is URIpdf instead of url. The current code is probably quite
+% That's why its name is URI instead of url. The current code is probably quite
 % slow and will need a replacement.
-% \begin{macro}{ @@_text_convert_utf8/string:nN }
-% \begin{macro}{ @@_text_convert_utf8/string-print:nN }
-% \begin{macro}{ @@_text_convert_utf8/URIpdf:nN }
-% \begin{macro}{ @@_text_convert_utf8/URIpdf-print:nN }
-% \begin{macro}{ @@_text_convert_utf16/string:nN }
-% \begin{macro}{ @@_text_convert_utf16/string-print:nN }
-% \begin{macro}{ @@_text_convert_utf16/hex:nN }
-% \begin{macro}{ @@_text_convert_utf16/hex-print:nN }
+% \begin{macro}{ @@_string_from_unicode_utf8/string-raw:nN }
+% \begin{macro}{ @@_string_from_unicode_utf8/string:nN }
+% \begin{macro}{ @@_string_from_unicode_utf8/URI-raw:nN }
+% \begin{macro}{ @@_string_from_unicode_utf8/URI:nN }
+% \begin{macro}{ @@_string_from_unicode_utf16/string-raw:nN }
+% \begin{macro}{ @@_string_from_unicode_utf16/string:nN }
+% \begin{macro}{ @@_string_from_unicode_utf16/hex-raw:nN }
+% \begin{macro}{ @@_string_from_unicode_utf16/hex:nN }
 %    \begin{macrocode}
 %% TODO Names need a review when it is clear which converters
 %% are actually needed
@@ -324,7 +308,7 @@
 % "input" is utf8 for pdftex, empty (native) for unicode engine
 % commands to output literal strings  (...)
 
-\cs_new_protected:cpn { @@_text_convert_utf8/string:nN }  #1 #2
+\cs_new_protected:cpn { @@_string_from_unicode_utf8/string-raw:nN }  #1 #2
   {
      \str_set_convert:Nnnn #2
         { #1 }
@@ -332,14 +316,14 @@
         {utf8/string}
   }
 
-\cs_new_protected:cpn { @@_text_convert_utf8/string-print:nN } #1 #2
+\cs_new_protected:cpn { @@_string_from_unicode_utf8/string:nN } #1 #2
   {
-    \use:c { @@_text_convert_utf8/string:nN } { #1 } #2
+    \use:c { @@_string_from_unicode_utf8/string-raw:nN } { #1 } #2
     \str_put_left:Nn #2  {(}
     \str_put_right:Nn #2 {)}
   }
 % special url command:
-\cs_new_protected:cpx { @@_text_convert_utf8/URIpdf:nN }  #1 #2
+\cs_new_protected:cpx { @@_string_from_unicode_utf8/URI-raw:nN }  #1 #2
   {
      \exp_not:N \str_set_convert:Nnnn #2
        { #1 }
@@ -374,14 +358,14 @@
      \exp_not:N \str_replace_all:Nnn #2 {\c_percent_str 29} {\c_backslash_str)}
   }
 
-\cs_new_protected:cpn { @@_text_convert_utf8/URIpdf-print:nN } #1 #2
+\cs_new_protected:cpn { @@_string_from_unicode_utf8/URI:nN } #1 #2
   {
-     \use:c { @@_text_convert_utf8/URIpdf:nN } {#1} #2
+     \use:c { @@_string_from_unicode_utf8/URI-raw:nN } {#1} #2
      \str_put_left:Nn #2  {(}
      \str_put_right:Nn #2 {)}
   }
 % with utf16 with BE marker
-\cs_new_protected:cpn { @@_text_convert_utf16/string:nN }  #1 #2
+\cs_new_protected:cpn { @@_string_from_unicode_utf16/string-raw:nN }  #1 #2
   {
     \str_set_convert:Nnnn #2
       { #1 }
@@ -389,16 +373,14 @@
       {utf16/string}
   }
 
-\cs_new_protected:cpn { @@_text_convert_utf16/string-print:nN } #1 #2
+\cs_new_protected:cpn { @@_string_from_unicode_utf16/string:nN } #1 #2
   {
-    \use:c { @@_text_convert_utf16/string:nN } {#1} #2
+    \use:c { @@_string_from_unicode_utf16/string-raw:nN } {#1} #2
     \str_put_left:Nn #2  {(}
     \str_put_right:Nn #2 {)}
   }
 
-% commands to output hex strings  (...)
-
-\cs_new_protected:cpn { @@_text_convert_utf16/hex:nN } #1 #2
+\cs_new_protected:cpn { @@_string_from_unicode_utf16/hex-raw:nN } #1 #2
   {
      \str_set_convert:Nnnn #2
        { #1 }
@@ -406,9 +388,9 @@
        {utf16/hex}
   }
 
-\cs_new_protected:cpn { @@_text_convert_utf16/hex-print:nN } #1 #2
+\cs_new_protected:cpn { @@_string_from_unicode_utf16/hex:nN } #1 #2
   {
-    \use:c { @@_text_convert_utf16/hex:nN } {#1} #2
+    \use:c { @@_string_from_unicode_utf16/hex-raw:nN } {#1} #2
     \str_put_left:Nn #2  {<}
     \str_put_right:Nn #2 {>}
   }
diff --git a/newpackages/new-attachfile.sty b/newpackages/new-attachfile.sty
index 9fe250e..332761e 100644
--- a/newpackages/new-attachfile.sty
+++ b/newpackages/new-attachfile.sty
@@ -151,7 +151,7 @@
             \pdfdict_remove:nn {file}{Subtype}
           }
           {
-            \pdfdict_put:nnx   {file}{Subtype}{\pdf_text_convert:nn {name}{#1} }
+            \pdfdict_put:nnx   {file}{Subtype}{\pdf_name_from_unicode_e:n{#1} }
           }
       }
     ,mimetype  .groups:n = { embed }
@@ -159,7 +159,7 @@
       {
         \tl_if_empty:nF { #1 }
           {
-           \pdf_text_convert:nnN {string-hex-print}  { #1 } \l__atfi_filename_tl %variable
+           \pdf_string_from_unicode:nnN {string-hex}  { #1 } \l__atfi_filename_tl %variable
            \pdfdict_put:nnx { file/FileSpec } {F}  { \l__atfi_filename_tl }
            \pdfdict_put:nnx { file/FileSpec } {UF} { \l__atfi_filename_tl }
           }
@@ -168,7 +168,7 @@
     ,afrelationship .choices:nn =
       {Source, Data, Alternative, Supplement, EncryptedPayload, FormData, Schema, Unspecified }
       {
-        \pdfdict_put:nnx { file/FileSpec } {AFRelationship }  { \pdf_text_convert:nn {name} {#1} }
+        \pdfdict_put:nnx { file/FileSpec } {AFRelationship }  { \pdf_name_from_unicode_e:n {#1} }
       }
     ,afrelationship .default:n = { Unspecified }
     ,afrelationship / .code:n =
@@ -192,7 +192,7 @@
                 \pdfdict_put:nnx
                   { file/FileSpec }
                   {AFRelationship }
-                  { \pdf_text_convert:nn {name} {#1} }
+                  { \pdf_name_from_unicode_e:n {#1} }
               }
           }
       }
@@ -207,7 +207,7 @@
             \pdfdict_remove:nn {file/FileSpec}{ModDate}
           }
           {
-            \pdfdict_put:nnx   {file}{ModDate}{\pdf_text_convert:nnN {string-lit}{#1} } %or print??
+            \pdfdict_put:nnx   {file}{ModDate}{\pdf_string_from_unicode:nnN {string}{#1} } %or print??
           }
       }
     ,moddate  .groups:n  = { embed }
diff --git a/testfiles-dvips/embedfile.pvt b/testfiles-dvips/embedfile.pvt
index dc36a6f..e9fb68a 100644
--- a/testfiles-dvips/embedfile.pvt
+++ b/testfiles-dvips/embedfile.pvt
@@ -16,7 +16,7 @@ grüße
 \ExplSyntaxOn
 \group_begin:
 \pdfdict_put:nnn  {l_pdffile/FileSpec} {AFRelationship}{/Source}
-\pdf_text_convert:nnN {utf16/string-print} {this~is~something~odd~with~öäü}\l_tmpa_str
+\pdf_string_from_unicode:nnN {utf16/string} {this~is~something~odd~with~öäü}\l_tmpa_str
 \pdfdict_put:nnx  {l_pdffile/FileSpec} {Desc}{\l_tmpa_str}
 \pdfdict_put:nnx  {l_pdffile/Params} {ModDate}{(D:20200422135851Z)}
 \pdffile_embed_file:nnn {testinput.txt}{grüße.txt}{example1}
@@ -25,7 +25,7 @@ grüße
 
 \group_begin:
 \pdfdict_put:nnn  {l_pdffile/FileSpec} {AFRelationship}{/Source}
-\pdf_text_convert:nnN {utf16/string-print} {this~is~something~odd~with~öäü}\l_tmpa_str
+\pdf_string_from_unicode:nnN {utf16/string} {this~is~something~odd~with~öäü}\l_tmpa_str
 \pdfdict_put:nnx  {l_pdffile/FileSpec} {Desc}{\l_tmpa_str}
 \pdfdict_put:nnx  {l_pdffile/Params} {ModDate}{(D:20200422155851+02'00')}
 \pdffile_embed_file:nnn {grüße.txt}{echtegrüße.txt}{example2}
diff --git a/testfiles-dvips/infodict.pvt b/testfiles-dvips/infodict.pvt
index 2631967..2f72124 100644
--- a/testfiles-dvips/infodict.pvt
+++ b/testfiles-dvips/infodict.pvt
@@ -4,7 +4,7 @@
 \RequirePackage{pdfmanagement-regressiontest}
 \documentclass{article}
 \ExplSyntaxOn
-\pdf_text_convert:nnN {utf16/string-print}{Grüße}\l_tmpa_str
+\pdf_string_from_unicode:nnN {utf16/string}{Grüße}\l_tmpa_str
 \pdfmanagement_add:nnx {Info} {Title}{\l_tmpa_str}
 \pdfmanagement_add:nnx {Info} {Author}{(Some~Author)}
 \ExplSyntaxOff
diff --git a/testfiles-dvips/text-convert.lvt b/testfiles-dvips/text-convert.lvt
index 946d2d0..427d8b9 100644
--- a/testfiles-dvips/text-convert.lvt
+++ b/testfiles-dvips/text-convert.lvt
@@ -8,18 +8,43 @@
 
 \begin{document}
 \START \showoutput
-\ExplSyntaxOn \providecommand\x{}
-\pdf_text_convert:nn{name}{abc/abc}
-\pdf_text_convert:nn{name-print}{abc/abc}
-\pdf_text_convert:nnN{name-print}{abc/abc}\x
-\show\x
-\pdf_text_convert:nnN{utf16/string}{abc/abc}\x
-\show\x
-\pdf_text_convert:nnN{utf16/string-print}{abc/abc}\x
-\show\x
-\pdf_text_convert:nnN{utf16/hex}{abc/abc}\x
-\show\x
-\pdf_text_convert:nnN{utf16/hex-print}{abc/abc}\x
-\show\x
+\ExplSyntaxOn 
+\TESTEXP {show~name}
+ {
+   \str_convert_pdfname:e    {abc~aaa/abc}
+   \pdf_name_from_unicode_e:n{abc~aaa/abc}
+ }
+
+\TEST{show~string-raw}
+ {
+   \pdf_string_from_unicode:nnN{utf16/string-raw}{abc/abc}\l_tmpa_str
+   \str_if_eq:onTF { \l_tmpa_str } 
+     { \376\377\000a\000b\000c\000/\000a\000b\000c } { \TRUE } { \ERROR }
+   \pdf_string_from_unicode:nnN{utf16/string}{abc/abc}\l_tmpa_str
+     \str_if_eq:onTF { \l_tmpa_str }
+     { (\376\377\000a\000b\000c\000/\000a\000b\000c) } { \TRUE } { \ERROR }
+ 
+ }
+
+
+\TEST{show~string-hex}
+ {
+   \pdf_string_from_unicode:nnN{utf16/hex-raw}{abc/abc}\l_tmpa_str
+   \str_if_eq:onTF { \l_tmpa_str }
+     { FEFF006100620063002F006100620063 } { \TRUE } { \ERROR }
+   \pdf_string_from_unicode:nnN{utf16/hex}{abc/abc}\l_tmpa_str
+   \str_if_eq:onTF { \l_tmpa_str }
+     { <FEFF006100620063002F006100620063> } { \TRUE } { \ERROR }
+
+ }
+
+
+\TEST{show~string-URI}
+ {
+   \pdf_string_from_unicode:nnN{utf8/URI}{https://www.123.cy&abc=blub+}\l_tmpa_str
+   \str_if_eq:onTF { \l_tmpa_str }
+     { (https://www.123.cy&abc=blub+) } { \TRUE } { \ERROR }
+ }
+
 \ExplSyntaxOff
 \end{document} 
\ No newline at end of file
diff --git a/testfiles-dvips/text-convert.tlg b/testfiles-dvips/text-convert.tlg
index 2466243..5b71079 100644
--- a/testfiles-dvips/text-convert.tlg
+++ b/testfiles-dvips/text-convert.tlg
@@ -1,88 +1,25 @@
 This is a generated file for the l3build validation system.
 Don't change this file in any respect.
-> \x=macro:
-->/abc#2Fabc.
-l. ...\show\x
-> \x=macro:
-->\376\377\000a\000b\000c\000/\000a\000b\000c.
-l. ...\show\x
-> \x=macro:
-->(\376\377\000a\000b\000c\000/\000a\000b\000c).
-l. ...\show\x
-> \x=macro:
-->FEFF006100620063002F006100620063.
-l. ...\show\x
-> \x=macro:
--><FEFF006100620063002F006100620063>.
-l. ...\show\x
-Completed box being shipped out [1]
-\vbox(633.0+0.0)x407.0
-.\hbox(0.0+0.0)x0.0
-.\hbox(0.0+0.0)x0.0
-..\kern -72.26999
-..\vbox(0.0+0.0)x0.0, glue set 72.26999fil
-...\kern -72.26999
-...\hbox(0.0+0.0)x0.0
-....\special{ps: [{ThisPage}<<>> /PUT pdfmark}
-....\glue 0.0 plus 1.0fil minus 1.0fil
-...\glue 0.0 plus 1.0fil minus 1.0fil
-.\glue 16.0
-.\vbox(617.0+0.0)x345.0, shifted 62.0
-..\vbox(12.0+0.0)x345.0, glue set 12.0fil
-...\glue 0.0 plus 1.0fil
-...\hbox(0.0+0.0)x345.0
-..\glue 25.0
-..\glue(\lineskip) 0.0
-..\vbox(550.0+0.0)x345.0, glue set 539.94232fil
-...\write-{}
-...\glue(\topskip) 2.5
-...\hbox(7.5+2.5)x345.0, glue set 225.83305fil
-....\hbox(0.0+0.0)x15.0
-....\OT1/cmr/m/n/10 a
-....\OT1/cmr/m/n/10 b
-....\kern0.27779
-....\OT1/cmr/m/n/10 c
-....\OT1/cmr/m/n/10 #
-....\OT1/cmr/m/n/10 2
-....\OT1/cmr/m/n/10 F
-....\kern-0.83334
-....\OT1/cmr/m/n/10 a
-....\OT1/cmr/m/n/10 b
-....\kern0.27779
-....\OT1/cmr/m/n/10 c
-....\OT1/cmr/m/n/10 /
-....\OT1/cmr/m/n/10 a
-....\OT1/cmr/m/n/10 b
-....\kern0.27779
-....\OT1/cmr/m/n/10 c
-....\OT1/cmr/m/n/10 #
-....\OT1/cmr/m/n/10 2
-....\OT1/cmr/m/n/10 F
-....\kern-0.83334
-....\OT1/cmr/m/n/10 a
-....\OT1/cmr/m/n/10 b
-....\kern0.27779
-....\OT1/cmr/m/n/10 c
-....\penalty 10000
-....\glue(\parfillskip) 0.0 plus 1.0fil
-....\glue(\rightskip) 0.0
-...\glue -2.5
-...\glue 0.0 plus 1.0fil
-...\glue 0.0
-...\glue 0.0 plus 0.0001fil
-..\glue(\baselineskip) 23.55556
-..\hbox(6.44444+0.0)x345.0, glue set 170.0fil
-...\glue 0.0 plus 1.0fil
-...\OT1/cmr/m/n/10 1
-...\glue 0.0 plus 1.0fil
-.\kern 0.0
-.\kern 0.0
-.\kern -633.0
-.\hbox(0.0+0.0)x0.0
-..\special{ps: [ /PAGES pdfmark}
-..\special{ps:SDict begin mark/Creator (TeX)/DOCINFO pdfmark end}
-..\special{ps:SDict begin mark/CreationDate (D:20010101205959-00'00')/DOCINFO pd\ETC.}
-..\special{ps:SDict begin mark/ModDate (D:20010101205959-00'00')/DOCINFO pdfmark\ETC.}
-..\special{ps:SDict begin mark{Catalog}<</Lang (en-US)>>/PUT pdfmark end}
-.\kern 633.0
+============================================================
+TEST 1: show name
+============================================================
+abc#20aaa#2Fabc/abc#20aaa#2Fabc
+============================================================
+============================================================
+TEST 2: show string-raw
+============================================================
+TRUE
+TRUE
+============================================================
+============================================================
+TEST 3: show string-hex
+============================================================
+TRUE
+TRUE
+============================================================
+============================================================
+TEST 4: show string-URI
+============================================================
+TRUE
+============================================================
 (text-convert.aux)
diff --git a/testfiles/embedfile.pvt b/testfiles/embedfile.pvt
index dc36a6f..e9fb68a 100644
--- a/testfiles/embedfile.pvt
+++ b/testfiles/embedfile.pvt
@@ -16,7 +16,7 @@ grüße
 \ExplSyntaxOn
 \group_begin:
 \pdfdict_put:nnn  {l_pdffile/FileSpec} {AFRelationship}{/Source}
-\pdf_text_convert:nnN {utf16/string-print} {this~is~something~odd~with~öäü}\l_tmpa_str
+\pdf_string_from_unicode:nnN {utf16/string} {this~is~something~odd~with~öäü}\l_tmpa_str
 \pdfdict_put:nnx  {l_pdffile/FileSpec} {Desc}{\l_tmpa_str}
 \pdfdict_put:nnx  {l_pdffile/Params} {ModDate}{(D:20200422135851Z)}
 \pdffile_embed_file:nnn {testinput.txt}{grüße.txt}{example1}
@@ -25,7 +25,7 @@ grüße
 
 \group_begin:
 \pdfdict_put:nnn  {l_pdffile/FileSpec} {AFRelationship}{/Source}
-\pdf_text_convert:nnN {utf16/string-print} {this~is~something~odd~with~öäü}\l_tmpa_str
+\pdf_string_from_unicode:nnN {utf16/string} {this~is~something~odd~with~öäü}\l_tmpa_str
 \pdfdict_put:nnx  {l_pdffile/FileSpec} {Desc}{\l_tmpa_str}
 \pdfdict_put:nnx  {l_pdffile/Params} {ModDate}{(D:20200422155851+02'00')}
 \pdffile_embed_file:nnn {grüße.txt}{echtegrüße.txt}{example2}
diff --git a/testfiles/infodict.pvt b/testfiles/infodict.pvt
index 2631967..2f72124 100644
--- a/testfiles/infodict.pvt
+++ b/testfiles/infodict.pvt
@@ -4,7 +4,7 @@
 \RequirePackage{pdfmanagement-regressiontest}
 \documentclass{article}
 \ExplSyntaxOn
-\pdf_text_convert:nnN {utf16/string-print}{Grüße}\l_tmpa_str
+\pdf_string_from_unicode:nnN {utf16/string}{Grüße}\l_tmpa_str
 \pdfmanagement_add:nnx {Info} {Title}{\l_tmpa_str}
 \pdfmanagement_add:nnx {Info} {Author}{(Some~Author)}
 \ExplSyntaxOff
diff --git a/testfiles/text-convert.luatex.tlg b/testfiles/text-convert.luatex.tlg
deleted file mode 100644
index f069b92..0000000
--- a/testfiles/text-convert.luatex.tlg
+++ /dev/null
@@ -1,89 +0,0 @@
-This is a generated file for the l3build validation system.
-Don't change this file in any respect.
-> \x=macro:
-->/abc#2Fabc.
-l. ...\show\x
-> \x=macro:
-->\376\377\000a\000b\000c\000/\000a\000b\000c.
-l. ...\show\x
-> \x=macro:
-->(\376\377\000a\000b\000c\000/\000a\000b\000c).
-l. ...\show\x
-> \x=macro:
-->FEFF006100620063002F006100620063.
-l. ...\show\x
-> \x=macro:
--><FEFF006100620063002F006100620063>.
-l. ...\show\x
-Completed box being shipped out [1]
-\vbox(633.0+0.0)x407.0, direction TLT
-.\hbox(0.0+0.0)x0.0, direction TLT
-..\kern-72.26999
-..\vbox(0.0+0.0)x0.0, glue set 72.26999fil, direction TLT
-...\kern-72.26999
-...\hbox(0.0+0.0)x0.0, direction TLT
-....\latelua0{ltx.__pdf.backend_ThisPage_gpush(tex.count["g_shipout_readonly_in
-t"])}
-....\glue 0.0 plus 1.0fil minus 1.0fil
-...\glue 0.0 plus 1.0fil minus 1.0fil
-.\glue 16.0
-.\vbox(617.0+0.0)x345.0, shifted 62.0, direction TLT
-..\vbox(12.0+0.0)x345.0, glue set 12.0fil, direction TLT
-...\glue 0.0 plus 1.0fil
-...\hbox(0.0+0.0)x345.0, direction TLT
-..\glue 25.0
-..\glue(\lineskip) 0.0
-..\vbox(550.0+0.0)x345.0, glue set 539.94232fil, direction TLT
-...\latelua0{ltx.__pdf.Page.Resources.ExtGState=true}
-...\latelua0{ltx.pdf.Page_Resources_gpush(tex.count["g_shipout_readonly_int"])}
-...\write-{}
-...\glue(\topskip) 2.5
-...\hbox(7.5+2.5)x345.0, glue set 225.82fil, direction TLT
-....\localpar
-.....\localinterlinepenalty=0
-.....\localbrokenpenalty=0
-.....\localleftbox=null
-.....\localrightbox=null
-....\hbox(0.0+0.0)x15.0, direction TLT
-....\TU/lmr/m/n/10 a
-....\TU/lmr/m/n/10 b
-....\kern0.28 (font)
-....\TU/lmr/m/n/10 c
-....\TU/lmr/m/n/10 #
-....\TU/lmr/m/n/10 2
-....\TU/lmr/m/n/10 F
-....\kern-0.83 (font)
-....\TU/lmr/m/n/10 a
-....\TU/lmr/m/n/10 b
-....\kern0.28 (font)
-....\TU/lmr/m/n/10 c
-....\TU/lmr/m/n/10 /
-....\TU/lmr/m/n/10 a
-....\TU/lmr/m/n/10 b
-....\kern0.28 (font)
-....\TU/lmr/m/n/10 c
-....\TU/lmr/m/n/10 #
-....\TU/lmr/m/n/10 2
-....\TU/lmr/m/n/10 F
-....\kern-0.83 (font)
-....\TU/lmr/m/n/10 a
-....\TU/lmr/m/n/10 b
-....\kern0.28 (font)
-....\TU/lmr/m/n/10 c
-....\penalty 10000
-....\glue(\parfillskip) 0.0 plus 1.0fil
-....\glue(\rightskip) 0.0
-...\glue -2.5
-...\glue 0.0 plus 1.0fil
-...\glue 0.0
-...\glue 0.0 plus 0.0001fil
-..\glue(\baselineskip) 23.34
-..\hbox(6.66+0.0)x345.0, glue set 170.0fil, direction TLT
-...\glue 0.0 plus 1.0fil
-...\TU/lmr/m/n/10 1
-...\glue 0.0 plus 1.0fil
-.\kern0.0
-.\kern-633.0
-.\hbox(0.0+0.0)x0.0, direction TLT
-.\kern633.0
-(text-convert.aux)
diff --git a/testfiles/text-convert.lvt b/testfiles/text-convert.lvt
index 946d2d0..427d8b9 100644
--- a/testfiles/text-convert.lvt
+++ b/testfiles/text-convert.lvt
@@ -8,18 +8,43 @@
 
 \begin{document}
 \START \showoutput
-\ExplSyntaxOn \providecommand\x{}
-\pdf_text_convert:nn{name}{abc/abc}
-\pdf_text_convert:nn{name-print}{abc/abc}
-\pdf_text_convert:nnN{name-print}{abc/abc}\x
-\show\x
-\pdf_text_convert:nnN{utf16/string}{abc/abc}\x
-\show\x
-\pdf_text_convert:nnN{utf16/string-print}{abc/abc}\x
-\show\x
-\pdf_text_convert:nnN{utf16/hex}{abc/abc}\x
-\show\x
-\pdf_text_convert:nnN{utf16/hex-print}{abc/abc}\x
-\show\x
+\ExplSyntaxOn 
+\TESTEXP {show~name}
+ {
+   \str_convert_pdfname:e    {abc~aaa/abc}
+   \pdf_name_from_unicode_e:n{abc~aaa/abc}
+ }
+
+\TEST{show~string-raw}
+ {
+   \pdf_string_from_unicode:nnN{utf16/string-raw}{abc/abc}\l_tmpa_str
+   \str_if_eq:onTF { \l_tmpa_str } 
+     { \376\377\000a\000b\000c\000/\000a\000b\000c } { \TRUE } { \ERROR }
+   \pdf_string_from_unicode:nnN{utf16/string}{abc/abc}\l_tmpa_str
+     \str_if_eq:onTF { \l_tmpa_str }
+     { (\376\377\000a\000b\000c\000/\000a\000b\000c) } { \TRUE } { \ERROR }
+ 
+ }
+
+
+\TEST{show~string-hex}
+ {
+   \pdf_string_from_unicode:nnN{utf16/hex-raw}{abc/abc}\l_tmpa_str
+   \str_if_eq:onTF { \l_tmpa_str }
+     { FEFF006100620063002F006100620063 } { \TRUE } { \ERROR }
+   \pdf_string_from_unicode:nnN{utf16/hex}{abc/abc}\l_tmpa_str
+   \str_if_eq:onTF { \l_tmpa_str }
+     { <FEFF006100620063002F006100620063> } { \TRUE } { \ERROR }
+
+ }
+
+
+\TEST{show~string-URI}
+ {
+   \pdf_string_from_unicode:nnN{utf8/URI}{https://www.123.cy&abc=blub+}\l_tmpa_str
+   \str_if_eq:onTF { \l_tmpa_str }
+     { (https://www.123.cy&abc=blub+) } { \TRUE } { \ERROR }
+ }
+
 \ExplSyntaxOff
 \end{document} 
\ No newline at end of file
diff --git a/testfiles/text-convert.tlg b/testfiles/text-convert.tlg
index bcce3f8..5b71079 100644
--- a/testfiles/text-convert.tlg
+++ b/testfiles/text-convert.tlg
@@ -1,80 +1,25 @@
 This is a generated file for the l3build validation system.
 Don't change this file in any respect.
-> \x=macro:
-->/abc#2Fabc.
-l. ...\show\x
-> \x=macro:
-->\376\377\000a\000b\000c\000/\000a\000b\000c.
-l. ...\show\x
-> \x=macro:
-->(\376\377\000a\000b\000c\000/\000a\000b\000c).
-l. ...\show\x
-> \x=macro:
-->FEFF006100620063002F006100620063.
-l. ...\show\x
-> \x=macro:
--><FEFF006100620063002F006100620063>.
-l. ...\show\x
-Completed box being shipped out [1]
-\vbox(633.0+0.0)x407.0
-.\hbox(0.0+0.0)x0.0
-..\kern -72.26999
-..\vbox(0.0+0.0)x0.0, glue set 72.26999fil
-...\kern -72.26999
-...\hbox(0.0+0.0)x0.0
-....\glue 0.0 plus 1.0fil minus 1.0fil
-...\glue 0.0 plus 1.0fil minus 1.0fil
-.\glue 16.0
-.\vbox(617.0+0.0)x345.0, shifted 62.0
-..\vbox(12.0+0.0)x345.0, glue set 12.0fil
-...\glue 0.0 plus 1.0fil
-...\hbox(0.0+0.0)x345.0
-..\glue 25.0
-..\glue(\lineskip) 0.0
-..\vbox(550.0+0.0)x345.0, glue set 539.94232fil
-...\write-{}
-...\glue(\topskip) 2.5
-...\hbox(7.5+2.5)x345.0, glue set 225.83305fil
-....\hbox(0.0+0.0)x15.0
-....\OT1/cmr/m/n/10 a
-....\OT1/cmr/m/n/10 b
-....\kern0.27779
-....\OT1/cmr/m/n/10 c
-....\OT1/cmr/m/n/10 #
-....\OT1/cmr/m/n/10 2
-....\OT1/cmr/m/n/10 F
-....\kern-0.83334
-....\OT1/cmr/m/n/10 a
-....\OT1/cmr/m/n/10 b
-....\kern0.27779
-....\OT1/cmr/m/n/10 c
-....\OT1/cmr/m/n/10 /
-....\OT1/cmr/m/n/10 a
-....\OT1/cmr/m/n/10 b
-....\kern0.27779
-....\OT1/cmr/m/n/10 c
-....\OT1/cmr/m/n/10 #
-....\OT1/cmr/m/n/10 2
-....\OT1/cmr/m/n/10 F
-....\kern-0.83334
-....\OT1/cmr/m/n/10 a
-....\OT1/cmr/m/n/10 b
-....\kern0.27779
-....\OT1/cmr/m/n/10 c
-....\penalty 10000
-....\glue(\parfillskip) 0.0 plus 1.0fil
-....\glue(\rightskip) 0.0
-...\glue -2.5
-...\glue 0.0 plus 1.0fil
-...\glue 0.0
-...\glue 0.0 plus 0.0001fil
-..\glue(\baselineskip) 23.55556
-..\hbox(6.44444+0.0)x345.0, glue set 170.0fil
-...\glue 0.0 plus 1.0fil
-...\OT1/cmr/m/n/10 1
-...\glue 0.0 plus 1.0fil
-.\kern 0.0
-.\kern -633.0
-.\hbox(0.0+0.0)x0.0
-.\kern 633.0
+============================================================
+TEST 1: show name
+============================================================
+abc#20aaa#2Fabc/abc#20aaa#2Fabc
+============================================================
+============================================================
+TEST 2: show string-raw
+============================================================
+TRUE
+TRUE
+============================================================
+============================================================
+TEST 3: show string-hex
+============================================================
+TRUE
+TRUE
+============================================================
+============================================================
+TEST 4: show string-URI
+============================================================
+TRUE
+============================================================
 (text-convert.aux)
diff --git a/testfiles/text-convert.xetex.tlg b/testfiles/text-convert.xetex.tlg
deleted file mode 100644
index eb355ce..0000000
--- a/testfiles/text-convert.xetex.tlg
+++ /dev/null
@@ -1,73 +0,0 @@
-This is a generated file for the l3build validation system.
-Don't change this file in any respect.
-> \x=macro:
-->/abc#2Fabc.
-l. ...\show\x
-> \x=macro:
-->\376\377\000a\000b\000c\000/\000a\000b\000c.
-l. ...\show\x
-> \x=macro:
-->(\376\377\000a\000b\000c\000/\000a\000b\000c).
-l. ...\show\x
-> \x=macro:
-->FEFF006100620063002F006100620063.
-l. ...\show\x
-> \x=macro:
--><FEFF006100620063002F006100620063>.
-l. ...\show\x
-Completed box being shipped out [1]
-\vbox(633.0+0.0)x407.0
-.\hbox(0.0+0.0)x0.0
-..\special{pdf:obj @pdf.obj1 <<  >>}
-..\special{pdf:obj @pdf.obj2 <<  >>}
-..\special{pdf:obj @pdf.obj3 <<  >>}
-..\special{pdf:obj @pdf.obj4 <<  >>}
-..\special{pdfcolorstackinit 2 page direct (0 g 0 G)}
-..\special{pdfcolorstackinit 2 page direct (/opacity1 gs)}
-.\hbox(0.0+0.0)x0.0
-..\kern -72.26999
-..\vbox(0.0+0.0)x0.0, glue set 72.26999fil
-...\kern -72.26999
-...\hbox(0.0+0.0)x0.0
-....\special{pdf: put @thispage <<>>}
-....\special{pdf:put @resources <</ExtGState @pdf.obj1>>}
-....\glue 0.0 plus 1.0fil minus 1.0fil
-...\glue 0.0 plus 1.0fil minus 1.0fil
-.\glue 16.0
-.\vbox(617.0+0.0)x345.0, shifted 62.0
-..\vbox(12.0+0.0)x345.0, glue set 12.0fil
-...\glue 0.0 plus 1.0fil
-...\hbox(0.0+0.0)x345.0
-..\glue 25.0
-..\glue(\lineskip) 0.0
-..\vbox(550.0+0.0)x345.0, glue set 539.94232fil
-...\special{pdf:put @pdf.obj1<</opacity1 <</ca 1/CA 1>>>>}
-...\write-{}
-...\glue(\topskip) 2.5
-...\hbox(7.5+2.49998)x345.0, glue set 225.81999fil
-....\hbox(0.0+0.0)x15.0
-....\TU/lmr/m/n/10 abc#2Fabc/abc#2Fabc
-....\penalty 10000
-....\glue(\parfillskip) 0.0 plus 1.0fil
-....\glue(\rightskip) 0.0
-...\glue -2.49998
-...\glue 0.0 plus 1.0fil
-...\glue 0.0
-...\glue 0.0 plus 0.0001fil
-..\glue(\baselineskip) 23.34
-..\hbox(6.66+0.0)x345.0, glue set 170.0fil
-...\glue 0.0 plus 1.0fil
-...\TU/lmr/m/n/10 1
-...\glue 0.0 plus 1.0fil
-.\kern 0.0
-.\kern 0.0
-.\kern -633.0
-.\hbox(0.0+0.0)x0.0
-..\special{pdf:put @pages <<>>}
-..\special{pdf:docinfo<</Creator (TeX)>>}
-..\special{pdf:docinfo<</Producer (xetex)>>}
-..\special{pdf:docinfo<</CreationDate (D:20010101194934+01'00')>>}
-..\special{pdf:docinfo<</ModDate (D:20010101205959-00'00')>>}
-..\special{pdf:put @catalog<</Lang (en-US)>>}
-.\kern 633.0
-(text-convert.aux)





More information about the latex3-commits mailing list.