diff --git a/source/texk/web2c/eptexdir/eptex.defines b/source/texk/web2c/eptexdir/eptex.defines index 165d23acee..09caabe63b 100644 --- a/source/texk/web2c/eptexdir/eptex.defines +++ b/source/texk/web2c/eptexdir/eptex.defines @@ -34,6 +34,7 @@ @define function fromKUTEN (); @define function UCStoUTF8 (); @define function fromUCS (); +@define function toJIS (); @define function toUCS (); @define function notkanjicharseq (); diff --git a/source/texk/web2c/euptexdir/euptex.defines b/source/texk/web2c/euptexdir/euptex.defines index ac6960dcef..a6cf3b7e4a 100644 --- a/source/texk/web2c/euptexdir/euptex.defines +++ b/source/texk/web2c/euptexdir/euptex.defines @@ -38,6 +38,7 @@ @define function fromKUTEN (); @define function fromUCS (); @define function UCStoUTF8 (); +@define function toJIS (); @define function toUCS (); @define function notkanjicharseq (); diff --git a/source/texk/web2c/ptexdir/ptex-base.ch b/source/texk/web2c/ptexdir/ptex-base.ch index db61640677..9ac9b0ce6a 100644 --- a/source/texk/web2c/ptexdir/ptex-base.ch +++ b/source/texk/web2c/ptexdir/ptex-base.ch @@ -3510,7 +3510,13 @@ continue: synch_h; end; p:=link(p); - jc:=toDVI(KANJI(info(p))); + jc:=KANJI(info(p)); + if font_enc[f]=2 then {Unicode TFM} + jc:=toUCS(jc) + else if font_enc[f]=1 then {JIS-encoded TFM} + jc:=toJIS(jc) + else + jc:=toDVI(jc); dvi_out(set2); dvi_out(Hi(jc)); dvi_out(Lo(jc)); cur_h:=cur_h+char_width(f)(orig_char_info(f)(c)); {not |jc|} end; diff --git a/source/texk/web2c/ptexdir/ptex.defines b/source/texk/web2c/ptexdir/ptex.defines index 63801c1930..1bf613dce5 100644 --- a/source/texk/web2c/ptexdir/ptex.defines +++ b/source/texk/web2c/ptexdir/ptex.defines @@ -27,6 +27,7 @@ @define function fromSJIS (); @define function fromKUTEN (); @define function fromUCS (); +@define function toJIS (); @define function toUCS (); @define function notkanjicharseq (); diff --git a/source/texk/web2c/uptexdir/uptex-m.ch b/source/texk/web2c/uptexdir/uptex-m.ch index 18231938a2..4ce7021d73 100644 --- a/source/texk/web2c/uptexdir/uptex-m.ch +++ b/source/texk/web2c/uptexdir/uptex-m.ch @@ -757,10 +757,14 @@ if (cur_cmd>=kanji)and(cur_cmd<=hangul) then @z @x - jc:=toDVI(KANJI(info(p))); + jc:=KANJI(info(p)); +@y + jc:=KANJI(info(p)) mod max_cjk_val; +@z + +@x dvi_out(set2); dvi_out(Hi(jc)); dvi_out(Lo(jc)); @y - jc:=toDVI(KANJI(info(p)) mod max_cjk_val); if (jc<@"10000) then begin dvi_out(set2); end else begin diff --git a/source/texk/web2c/uptexdir/uptex.defines b/source/texk/web2c/uptexdir/uptex.defines index 81adea6de5..33f9a01c24 100644 --- a/source/texk/web2c/uptexdir/uptex.defines +++ b/source/texk/web2c/uptexdir/uptex.defines @@ -36,6 +36,7 @@ @define function fromSJIS (); @define function fromKUTEN (); @define function fromUCS (); +@define function toJIS (); @define function toUCS (); @define function notkanjicharseq ();