diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni.sty | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni.sty b/Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni.sty index 31c1de3584d..9d6cf4e1358 100644 --- a/Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni.sty +++ b/Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni.sty @@ -6,7 +6,7 @@ %% %% xCJK2uni.dtx (with options: `package') %% -%% Copyright (C) 2013-2014 by Qing Lee <sobenlee@gmail.com> +%% Copyright (C) 2013-2014, 2016 by Qing Lee <sobenlee@gmail.com> %% -------------------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,11 +21,20 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xCJK2uni.dtx 691 2014-06-20 09:20:07Z sobenlee $ +\GetIdInfo$Id: xCJK2uni.dtx 917f10e 2016-02-02 16:55:04 +0800 Qing Lee <sobenlee@gmail.com> $ {Convert CJK character to Unicode.} \ProvidesExplPackage{\ExplFileName} - {\ExplFileDate}{0.4}{\ExplFileDescription} -\pdftex_if_engine:F + {\ExplFileDate}{0.5}{\ExplFileDescription} +\msg_new:nnn { xCJK2uni } { l3-too-old } + { + Support~package~'expl3'~too~old. \\\\ + Please~update~an~up~to~date~version~of~the~bundles\\\\ + 'l3kernel'~and~'l3packages'\\\\ + using~your~TeX~package~manager~or~from~CTAN. + } +\@ifpackagelater { expl3 } { 2015/09/24 } { } + { \msg_error:nn { xCJK2uni } { l3-too-old } } +\sys_if_engine_pdftex:F { \msg_new:nnn { xCJK2uni } { pdflatex } { The~xCJK2uni~package~is~only~supported~in~pdfTeX. } @@ -106,18 +115,22 @@ \__CJKtu_set_enc:nnnnnn { GBK } { UGBK } { "81 } { "40 } { "7E } { "80 } \cs_new_nopar:Npn \__CJKtu_sfd_to_unicode:nn #1#2 { - \tex_romannumeral:D -`0 \exp_last_unbraced:Nf - \__CJKtu_get_unicode:w \CJKtu_sfd_map:nn {#1} {#2} \s__stop + \exp:w \exp_last_unbraced:Nf + \__CJKtu_get_unicode:w \CJKtu_sfd_map:nn {#1} {#2} \exp_end: + } +\cs_new_nopar:Npn \__CJKtu_get_unicode:w #1 \exp_end: + { + \tl_if_empty:nTF {#1} + { \exp_end: } + { \__CJKtu_get_unicode_aux:w #1 \q_stop } } -\cs_new_nopar:Npn \__CJKtu_get_unicode:w #1 \s__stop - { \tl_if_empty:nF {#1} { \__CJKtu_get_unicode_aux:w #1 \q_stop } } \cs_new_nopar:Npn \__CJKtu_get_unicode_aux:w #1 \or: #2 \q_stop - { \or: #2 \exp_stop_f: #1 } + { \or: #2 \exp_end: #1 } \group_begin: \char_set_catcode_active:n { "7F } \cs_new_nopar:Npn \__CJKtu_char_to_unicode:n #1 { - \tex_romannumeral:D -`0 + \exp:w \int_compare:nNnTF { \tl_count:n {#1} } = \c_two { \CJKtu_byte:NN #1 } { @@ -161,7 +174,12 @@ { \__CJKtu_encoding_error: } } \cs_new_nopar:Npn \__CJKtu_encoding_error: - { \exp_stop_f: \__msg_expandable_error:n { Wrong~encoding~scheme. } } + { + \msg_expandable_error:nn { xCJK2uni } { encoding-error } + \exp_end: + } +\msg_new:nnn { xCJK2uni } { encoding-error } + { Wrong~encoding~scheme. } \cs_new_nopar:Npn \CJKtu_byte_map:nn #1#2 { \exp_args:Nf \__CJKtu_index_map:n @@ -185,7 +203,7 @@ } } \cs_new_nopar:Npn \__CJKtu_get_unicode:n #1 - { \exp_last_unbraced:Nf \__CJKtu_get_unicode:w #1 \s__stop } + { \exp_last_unbraced:Nf \__CJKtu_get_unicode:w #1 \exp_end: } \cs_new_nopar:Npn \__CJKtu_UTF_xvi_be:n #1 { \exp_args:Nf \__CJKtu_UTF_xvi_aux:n { \int_eval:n { "#1 } } } \cs_new_nopar:Npn \__CJKtu_UTF_xvi_aux:n #1 |