diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf8.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf8.def | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf8.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf8.def index 486b12974a6..ac07909cf81 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf8.def +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf8.def @@ -37,7 +37,7 @@ \exp_after:wN \use_none_delimit_by_q_stop:w \fi: \exp_after:wN \__str_encode_utf_viii_loop:wwnnw - \__int_value:w \int_div_truncate:nn {#1} {64} ; #1 ; + \int_value:w \int_div_truncate:nn {#1} {64} ; #1 ; #5 \q_stop \__str_output_byte:n { #2 - 64 * ( #1 - 2 ) } } @@ -47,11 +47,14 @@ \flag_clear_new:n { str_overflow } \__kernel_msg_new:nnnn { str } { utf8-decode } { - Invalid~UTF-8~string: \exp_last_unbraced:Nf \use_none:n - \__str_if_flag_times:nT { str_missing } { ,~missing~continuation~byte } - \__str_if_flag_times:nT { str_extra } { ,~extra~continuation~byte } - \__str_if_flag_times:nT { str_overlong } { ,~overlong~form } - \__str_if_flag_times:nT { str_overflow } { ,~code~point~too~large } + Invalid~UTF-8~string: + \exp_last_unbraced:Nf \use_none:n + { + \__str_if_flag_times:nT { str_missing } { ,~missing~continuation~byte } + \__str_if_flag_times:nT { str_extra } { ,~extra~continuation~byte } + \__str_if_flag_times:nT { str_overlong } { ,~overlong~form } + \__str_if_flag_times:nT { str_overflow } { ,~code~point~too~large } + } . } { @@ -99,8 +102,8 @@ \tl_gset:Nx \g__str_result_tl { \exp_after:wN \__str_decode_utf_viii_start:N \g__str_result_tl - { \__prg_break: \__str_decode_utf_viii_end: } - \__prg_break_point: + { \prg_break: \__str_decode_utf_viii_end: } + \prg_break_point: } \__str_if_flag_error:nnx { str_error } { utf8-decode } { } } @@ -110,7 +113,7 @@ \if_int_compare:w `#1 < "C0 \exp_stop_f: \s__tl \if_int_compare:w `#1 < "80 \exp_stop_f: - \__int_value:w `#1 + \int_value:w `#1 \else: \flag_raise:n { str_extra } \flag_raise:n { str_error } @@ -118,7 +121,7 @@ \fi: \else: \exp_after:wN \__str_decode_utf_viii_continuation:wwN - \__int_value:w \__int_eval:w `#1 - "C0 \exp_after:wN \__int_eval_end: + \int_value:w \int_eval:n { `#1 - "C0 } \exp_after:wN \fi: \s__tl \use_none_delimit_by_q_stop:w {"80} {"800} {"10000} {"110000} \q_stop @@ -133,9 +136,7 @@ "C0 \exp_stop_f: #3 \exp_after:wN \__str_decode_utf_viii_aux:wNnnwN - \__int_value:w \__int_eval:w - #1 * "40 + `#3 - "80 - \exp_after:wN \__int_eval_end: + \int_value:w \int_eval:n { #1 * "40 + `#3 - "80 } \exp_after:wN \else: \s__tl \flag_raise:n { str_missing } @@ -163,7 +164,7 @@ \__str_decode_utf_viii_overflow:w #1 \fi: \exp_after:wN \__str_decode_utf_viii_continuation:wwN - \__int_value:w \__int_eval:w #1 - #4 \exp_after:wN \__int_eval_end: + \int_value:w \int_eval:n { #1 - #4 } \exp_after:wN \fi: \s__tl #2 {#4} #5 @@ -182,7 +183,7 @@ \flag_raise:n { str_missing } \flag_raise:n { str_error } \int_use:N \c__str_replacement_char_int \s__tl - \__prg_break: + \prg_break: } %% %% |