diff --git a/plexpl3.dtx b/plexpl3.dtx index 5ccb2fc..a426d34 100644 --- a/plexpl3.dtx +++ b/plexpl3.dtx @@ -606,6 +606,88 @@ { \__regex_replacement_put:n {#2} } % \end{macrocode} % +% \subsection{コードポイント関数の修正} +% +% Fix for codepoint functions in \file{l3text}. +% \begin{macrocode} +%<@@=text> +% \end{macrocode} +% \begin{macrocode} +\cs_gset:Npn \@@_codepoint_process:nN #1#2 + { +% \end{macrocode} +% Check if the given character token is a jachar. +% One jachar token is one codepoint. +% \begin{macrocode} + \token_if_jachar:NTF #2 + { \use:n } + { + \int_compare:nNnTF { `#2 } > { "80 } + { + \int_compare:nNnTF { `#2 } < { "E0 } + { \@@_codepoint_process:nNN } + { + \int_compare:nNnTF { `#2 } < { "F0 } + { \@@_codepoint_process:nNNN } + { \@@_codepoint_process:nNNNN } + } + } + } + { \use:n } + {#1} #2 + } +% \end{macrocode} +% \begin{macrocode} +\cs_gset:Npn \@@_codepoint_compare:N #1 + { +% \end{macrocode} +% Check if the given character token is a jachar. +% \begin{macrocode} + \token_if_jachar:NTF #1 + { \@@_codepoint_compare_jachar:N } + { + \if_int_compare:w `#1 > "80 \exp_stop_f: + \if_int_compare:w `#1 < "E0 \exp_stop_f: + \exp_after:wN \exp_after:wN \exp_after:wN + \@@_codepoint_compare:NN + \else: + \if_int_compare:w `#1 < "F0 \exp_stop_f: + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_after:wN \@@_codepoint_compare:NNN + \else: + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_after:wN \@@_codepoint_compare:NNNN + \fi: + \fi: + \else: + \exp_after:wN \@@_codepoint_compare_aux:N + \fi: + } + #1 + } +% \end{macrocode} +% \begin{macrocode} +\int_compare:nNnTF { \tex_jis:D "2121 } = { "3000 } + { +% \end{macrocode} +% up\TeX{} with unicode. +% \begin{macrocode} + \cs_new:Npn \@@_codepoint_compare_jachar:N #1 { `#1 } + } + { +% \end{macrocode} +% p\TeX{} or up\TeX{} with euc/sjis. +% \begin{macrocode} + \cs_new:Npn \@@_codepoint_compare_jachar:N #1 + { \tex_toucs:D `#1 \exp_stop_f: } + } +% \end{macrocode} +% \begin{macrocode} +%<@@=> +% \end{macrocode} +% % 以上です。 % \begin{macrocode} % diff --git a/testfiles/pl3text002.lvt b/testfiles/pl3text002.lvt new file mode 100644 index 0000000..d53fc1b --- /dev/null +++ b/testfiles/pl3text002.lvt @@ -0,0 +1,38 @@ +% +% Copyright (c) 2022 Japanese TeX Development Community +% +\epTeXinputencoding utf8 + +\input{regression-test} +\documentclass{minimal} +\RequirePackage[enable-debug]{expl3} +\ExplSyntaxOn +\debug_on:n { check-declarations , deprecation , log-functions } +\ExplSyntaxOff + +\RequirePackage{plexpl3} + +\begin{document} + +\START +\ExplSyntaxOn + +\cs_new:Npn \test_map:n #1 { [#1] } + +\TESTEXP { text_map_function } + { + \text_map_function:nN + { ABC~äëïöü~αβγ~あいうえお~か゚き゚く゚け゚こ゚~葛󠄀城市~葛󠄁飾区~☀☁☂☃~⛄👨‍👩‍👧‍👦💔 } + \test_map:n + } + +\TEST { text_map_inline } + { + \text_map_inline:nn + { ABC~äëïöü~αβγ~あいうえお~か゚き゚く゚け゚こ゚~葛󠄀城市~葛󠄁飾区~☀☁☂☃~⛄👨‍👩‍👧‍👦💔 } + { + \TYPE { [#1] } + } + } + +\END diff --git a/testfiles/pl3text002.tlg b/testfiles/pl3text002.tlg new file mode 100644 index 0000000..3ccca6d --- /dev/null +++ b/testfiles/pl3text002.tlg @@ -0,0 +1,60 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +Defining \test_map:n on line ... +============================================================ +TEST 1: text_map_function +============================================================ +[A][B][C][ ][^^c3^^a4][^^c3^^ab][^^c3^^af][^^c3^^b6][^^c3^^bc][ ][α][β][γ][ ][あ][い][う][え][お][ ][か^^e3^^82^^9a][き^^e3^^82^^9a][く^^e3^^82^^9a][け^^e3 +^^82^^9a][こ^^e3^^82^^9a][ ][葛^^f3^^a0^^84^^80][城][市][ ][葛^^f3^^a0^^84^^81] +[飾][区][ ][^^e2^^98^^80][^^e2^^98^^81][^^e2^^98^^82][^^e2^^98^^83][ ][^^e2^^9b +^^84][^^f0^^9f^^91^^a8^^e2^^80^^8d][^^f0^^9f^^91^^a9^^e2^^80^^8d][^^f0^^9f^^91^^a7^^e2^^80^^8d][^^f0^^9f^^91^^a6][^^f0^^9f^^92^^94] +============================================================ +============================================================ +TEST 2: text_map_inline +============================================================ +[A] +[B] +[C] +[ ] +[^^c3^^a4] +[^^c3^^ab] +[^^c3^^af] +[^^c3^^b6] +[^^c3^^bc] +[ ] +[α] +[β] +[γ] +[ ] +[あ] +[い] +[う] +[え] +[お] +[ ] +[か^^e3^^82^^9a] +[き^^e3^^82^^9a] +[く^^e3^^82^^9a] +[け^^e3^^82^^9a] +[こ^^e3^^82^^9a] +[ ] +[葛^^f3^^a0^^84^^80] +[城] +[市] +[ ] +[葛^^f3^^a0^^84^^81] +[飾] +[区] +[ ] +[^^e2^^98^^80] +[^^e2^^98^^81] +[^^e2^^98^^82] +[^^e2^^98^^83] +[ ] +[^^e2^^9b^^84] +[^^f0^^9f^^91^^a8^^e2^^80^^8d] +[^^f0^^9f^^91^^a9^^e2^^80^^8d] +[^^f0^^9f^^91^^a7^^e2^^80^^8d] +[^^f0^^9f^^91^^a6] +[^^f0^^9f^^92^^94] +============================================================ diff --git a/testfiles/pl3text002.uptex.tlg b/testfiles/pl3text002.uptex.tlg new file mode 100644 index 0000000..0f6e253 --- /dev/null +++ b/testfiles/pl3text002.uptex.tlg @@ -0,0 +1,59 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +Defining \test_map:n on line ... +============================================================ +TEST 1: text_map_function +============================================================ +[A][B][C][ ][^^c3^^a4][^^c3^^ab][^^c3^^af][^^c3^^b6][^^c3^^bc][ ][α][β][γ][ ][あ][い][う][え][お][ ][か゚][き゚][く゚][け゚][こ゚][ ][葛 +󠄀][城][市][ ][葛󠄁][飾][区][ ][☀][☁][☂][☃][ ][⛄][👨‍][ +👩‍][👧‍][👦][💔] +============================================================ +============================================================ +TEST 2: text_map_inline +============================================================ +[A] +[B] +[C] +[ ] +[^^c3^^a4] +[^^c3^^ab] +[^^c3^^af] +[^^c3^^b6] +[^^c3^^bc] +[ ] +[α] +[β] +[γ] +[ ] +[あ] +[い] +[う] +[え] +[お] +[ ] +[か゚] +[き゚] +[く゚] +[け゚] +[こ゚] +[ ] +[葛󠄀] +[城] +[市] +[ ] +[葛󠄁] +[飾] +[区] +[ ] +[☀] +[☁] +[☂] +[☃] +[ ] +[⛄] +[👨‍] +[👩‍] +[👧‍] +[👦] +[💔] +============================================================