Skip to content

Commit

Permalink
ptexenc: Accept new internal encoding of upTeX also with pTeX mode
Browse files Browse the repository at this point in the history
git-svn-id: svn://tug.org/texlive/trunk/Build/source@71231 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
t-tk committed May 11, 2024
1 parent 321e9ab commit de8947d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions texk/ptexenc/ChangeLog
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
8 changes: 8 additions & 0 deletions texk/ptexenc/ptexenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions texk/ptexenc/unicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ long UCStoUTF8(long ucs)
}


#define UCS_MAX 0x110000L

/* using over U+10.FFFF Area */
long UCStoUPTEX (long ucs)
{
return ucs;
Expand All @@ -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;
}

Expand Down

0 comments on commit de8947d

Please sign in to comment.