diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty index 7d527b6d264..cc4d6716ed5 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty @@ -13,7 +13,7 @@ %% %% Do not distribute a modified version of this file. %% -%% File: l3str.dtx Copyright (C) 2011 The LaTeX3 Project +%% File: l3str.dtx Copyright (C) 2011-2012 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -46,10 +46,11 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{expl3} -\GetIdInfo$Id: l3str.dtx 3088 2011-12-23 02:00:14Z bruno $ +\GetIdInfo$Id: l3str.dtx 3159 2012-01-09 00:51:58Z bruno $ {L3 Experimental Strings} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\RequirePackage{l3tl-analysis} \group_begin: \cs_set_protected_nopar:Npn \str_tmp:w #1 { @@ -495,11 +496,11 @@ { \exp_after:wN \str_aux_gmap_internal_result_loop:Nww \exp_after:wN #1 - \g_str_result_tl \q_mark \q_stop \prg_map_break: , + \g_str_result_tl \s_tl \q_stop \prg_map_break: \s_tl \prg_break_point:n { } } } -\cs_new_nopar:Npn \str_aux_gmap_internal_result_loop:Nww #1#2\q_mark #3, +\cs_new_nopar:Npn \str_aux_gmap_internal_result_loop:Nww #1 #2 \s_tl #3 \s_tl { \use_none_delimit_by_q_stop:w #3 \q_stop #1 {#3} @@ -819,19 +820,20 @@ \use_none_delimit_by_q_stop:w #1 \q_stop \tex_dimen:D "#1 = \l_str_tmpa_int sp \scan_stop: \tex_skip:D \l_str_tmpa_int = "#1 sp \scan_stop: - \tex_toks:D \l_str_tmpa_int \exp_after:wN { \int_value:w "FFFD } + \tex_toks:D \l_str_tmpa_int \exp_after:wN + { \int_use:N \c_str_replacement_char_int } \tex_advance:D \l_str_tmpa_int \c_one \str_convert_from_eight_bit_load_missing:n } \cs_new:Npn \str_convert_from_eight_bit_aux:N #1 { - #1 \exp_not:N \q_mark + #1 \s_tl \if_num:w \tex_dimen:D `#1 < \l_str_tmpa_int \if_num:w \tex_skip:D \tex_dimen:D `#1 = `#1 \exp_stop_f: \tex_the:D \tex_toks:D \tex_dimen:D \fi: \fi: - \int_value:w `#1 , + \int_value:w `#1 \s_tl } \cs_new_protected:Npn \str_convert_to_eight_bit:n #1 { @@ -856,7 +858,10 @@ } \cs_new:Npn \str_convert_to_eight_bit_aux:n #1 { - \if_num:w #1 < "8000 \exp_stop_f: + \if_num:w #1 > \c_max_register_int + \msg_expandable_kernel_error:nnn + { str } { eight-bit-to-byte-overflow } {#1} + \else: \if_num:w \tex_dimen:D #1 < \l_str_tmpa_int \if_num:w \tex_skip:D \tex_dimen:D #1 = #1 \exp_stop_f: \tex_the:D \tex_toks:D \tex_dimen:D #1 \exp_stop_f: @@ -864,9 +869,6 @@ \fi: \fi: \str_convert_to_eight_bit_aux_ii:n {#1} - \else: - \msg_expandable_kernel_error:nnn - { str } { eight-bit-to-byte-overflow } {#1} \fi: } \cs_new:Npn \str_convert_to_eight_bit_aux_ii:n #1 @@ -915,17 +917,17 @@ \cs_new_protected_nopar:Npn \str_convert_from_native: { \str_aux_gmap_result:N \str_convert_from_native_aux:N } \cs_new:Npn \str_convert_from_native_aux:N #1 - { #1 \exp_not:N \q_mark \int_value:w `#1 , } + { #1 \s_tl \int_value:w `#1 \s_tl } \cs_new_protected_nopar:Npn \str_convert_to_native: { \tl_set_eq:NN \l_str_tmpa_tl \g_str_result_tl \str_aux_convert_to_native:n { \exp_after:wN \str_convert_to_native_aux:w - \l_str_tmpa_tl \q_mark { \q_stop \prg_map_break: } , + \l_str_tmpa_tl \s_tl { \q_stop \prg_map_break: } \s_tl } } -\cs_new_protected_nopar:Npn \str_convert_to_native_aux:w #1\q_mark #2, +\cs_new_protected_nopar:Npn \str_convert_to_native_aux:w #1 \s_tl #2 \s_tl { \use_none_delimit_by_q_stop:w #2 \q_stop \str_aux_convert_to_native_step:n {#2} @@ -1028,6 +1030,8 @@ { Overlong~UTF-8~byte~sequence~for~code~point~#1. } \msg_kernel_new:nnn { str } { utf8-premature-end } { Incomplete~last~UTF-8~character. } +\msg_kernel_new:nnn { str } { utf8-overflow } + { Code~point~#1~too~large~(UTF-8). } \msg_kernel_new:nnn { str } { utf32-overflow } { Code~point~too~large~(UTF-32~`#1'). } \msg_kernel_new:nnn { str } { utf32-truncated } |