diff options
author | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2024-05-11 08:27:16 +0000 |
---|---|---|
committer | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2024-05-11 08:27:16 +0000 |
commit | bfd29cfaa5b3327efce745faab7b51150e421ed0 (patch) | |
tree | 16643dd316e40841fd64ffe6607356a052a14922 /Build/source | |
parent | e3abf41448ecfc4d76b643068ac24ee513292ef4 (diff) |
ptexenc: Accept new internal encoding of upTeX also with pTeX mode
git-svn-id: svn://tug.org/texlive/trunk@71231 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/ptexenc/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/ptexenc.c | 8 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/unicode.c | 5 |
3 files changed, 14 insertions, 5 deletions
diff --git a/Build/source/texk/ptexenc/ChangeLog b/Build/source/texk/ptexenc/ChangeLog index 3dc3578061d..cb4a228f78f 100644 --- a/Build/source/texk/ptexenc/ChangeLog +++ b/Build/source/texk/ptexenc/ChangeLog @@ -1,3 +1,9 @@ +2024-05-11 TANAKA Takuji <ttk@t-lab.opal.ne.jp> + + * unicode.c, ptexenc.c: + Enable to treat the new internal encoding of upTeX + also with pTeX mode (--kanji-internal={euc,sjis}). + 2024-04-27 TANAKA Takuji <ttk@t-lab.opal.ne.jp> * unicode.c, ptexenc/unicode.h: diff --git a/Build/source/texk/ptexenc/ptexenc.c b/Build/source/texk/ptexenc/ptexenc.c index 9531c2a6933..269cb8cee63 100644 --- a/Build/source/texk/ptexenc/ptexenc.c +++ b/Build/source/texk/ptexenc/ptexenc.c @@ -370,9 +370,17 @@ long fromDVI (long kcode) /* EUC */ return JIStoEUC(kcode); } +#define UCS_MAX 0x110000L + /* internal (EUC/SJIS/UPTEX) to DVI (JIS/UCS) code conversion */ long toDVI (long kcode) { + if (kcode >= UCS_MAX) { + if (kcode < UCS_MAX*2) /* for Japanese OTF package */ + return kcode % UCS_MAX; + else /* for upTeX internal encoding */ + return kcode; + } if (is_internalUPTEX()) return UPTEXtoUCS(kcode); if (is_internalSJIS()) return SJIStoJIS(kcode); /* EUC */ return EUCtoJIS(kcode); diff --git a/Build/source/texk/ptexenc/unicode.c b/Build/source/texk/ptexenc/unicode.c index 0a4b3b30a0d..367b2359e24 100644 --- a/Build/source/texk/ptexenc/unicode.c +++ b/Build/source/texk/ptexenc/unicode.c @@ -118,9 +118,6 @@ long UCStoUTF8(long ucs) } -#define UCS_MAX 0x110000L - -/* using over U+10.FFFF Area */ long UCStoUPTEX (long ucs) { return ucs; @@ -135,8 +132,6 @@ long UPTEXtoUCS (long uptex) if (UVS_divide_code(uptex, vs) == 0) return 0; return uptex; } - if (uptex>=UCS_MAX*2) return uptex; - if (uptex>=UCS_MAX) return uptex % UCS_MAX; /* for OTF package */ return uptex; } |