diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-convert.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-convert.sty | 74 |
1 files changed, 49 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-convert.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-convert.sty index 7ecf6196ed4..e811c9e00a9 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-convert.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-convert.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{expl3} -\GetIdInfo$Id: l3str-convert.dtx 5659 2015-07-14 18:58:00Z joseph $ +\GetIdInfo$Id: l3str-convert.dtx 5998 2015-09-11 19:51:00Z joseph $ {L3 Experimental string encoding conversions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -54,7 +54,15 @@ \cs_if_exist:NF \use_ii_i:nn { \cs_new:Npn \use_ii_i:nn #1#2 { #2 #1 } } \int_const:Nn \c_max_char_int - { \pdftex_if_engine:TF { "FF } { "10FFFF } } + { + \bool_if:nTF + { + \sys_if_engine_luatex_p: || + \sys_if_engine_xetex_p: + } + { "10FFFF } + { "FF } + } \cs_new_protected_nopar:Npn \__str_tmp:w { } \tl_new:N \l__str_internal_tl \int_new:N \l__str_internal_int @@ -399,8 +407,11 @@ \char_set_catcode_comment:N \% \int_set:Nn \tex_endlinechar:D {32} } -\pdftex_if_engine:TF - { \cs_new_eq:NN \__str_filter_bytes:n \use:n } +\bool_if:nTF + { + \sys_if_engine_luatex_p: || + \sys_if_engine_xetex_p: + } { \cs_new:Npn \__str_filter_bytes:n #1 { @@ -419,8 +430,12 @@ \__str_filter_bytes_aux:N } } -\pdftex_if_engine:TF - { \cs_new_protected_nopar:Npn \__str_convert_unescape_: { } } + { \cs_new_eq:NN \__str_filter_bytes:n \use:n } +\bool_if:nTF + { + \sys_if_engine_luatex_p: || + \sys_if_engine_xetex_p: + } { \cs_new_protected_nopar:Npn \__str_convert_unescape_: { @@ -430,6 +445,7 @@ \__str_if_flag_error:nnx { str_byte } { non-byte } { bytes } } } + { \cs_new_protected_nopar:Npn \__str_convert_unescape_: { } } \cs_new_eq:NN \__str_convert_unescape_bytes: \__str_convert_unescape_: \cs_new_protected_nopar:Npn \__str_convert_escape_: { } \cs_new_eq:NN \__str_convert_escape_bytes: \__str_convert_escape_: @@ -439,7 +455,28 @@ { #1 \s__tl \__int_value:w `#1 \s__tl } \group_begin: \char_set_catcode_other:n { 0 } - \pdftex_if_engine:TF + \bool_if:nTF + { + \sys_if_engine_luatex_p: || + \sys_if_engine_xetex_p: + } + { + \cs_new_protected_nopar:Npn \__str_convert_encode_: + { + \__tl_gbuild_x:Nw \g__str_result_tl + \exp_after:wN \__str_encode_native_loop:w + \g__str_result_tl \s__tl { \q_stop \__prg_break: } \s__tl + \__prg_break_point: + \__tl_build_end: + } + \cs_new_protected:Npn \__str_encode_native_loop:w #1 \s__tl #2 \s__tl + { + \use_none_delimit_by_q_stop:w #2 \q_stop + \tex_lccode:D \l__str_internal_int \__int_eval:w #2 \__int_eval_end: + \tl_to_lowercase:n { \__tl_build_one:n { ^^@ } } + \__str_encode_native_loop:w + } + } { \cs_new_protected_nopar:Npn \__str_convert_encode_: { @@ -465,23 +502,6 @@ To~manipulate~arbitrary~Unicode,~use~LuaTeX~or~XeTeX. } } - { - \cs_new_protected_nopar:Npn \__str_convert_encode_: - { - \__tl_gbuild_x:Nw \g__str_result_tl - \exp_after:wN \__str_encode_native_loop:w - \g__str_result_tl \s__tl { \q_stop \__prg_break: } \s__tl - \__prg_break_point: - \__tl_build_end: - } - \cs_new_protected:Npn \__str_encode_native_loop:w #1 \s__tl #2 \s__tl - { - \use_none_delimit_by_q_stop:w #2 \q_stop - \tex_lccode:D \l__str_internal_int \__int_eval:w #2 \__int_eval_end: - \tl_to_lowercase:n { \__tl_build_one:n { ^^@ } } - \__str_encode_native_loop:w - } - } \group_end: \cs_new_protected_nopar:Npn \__str_convert_decode_clist: { @@ -614,7 +634,11 @@ } \__msg_kernel_new:nnn { str } { file-not-found } { File~'l3str-#1.def'~not~found. } -\pdftex_if_engine:F +\bool_if:nT + { + \sys_if_engine_luatex_p: || + \sys_if_engine_xetex_p: + } { \__msg_kernel_new:nnnn { str } { non-byte } { String~invalid~in~escaping~'#1':~it~may~only~contain~bytes. } |