diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-08-29 08:56:50 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-08-29 08:56:50 +0000 |
commit | 8ba5a3f89f2eb588e98f2dcf8aec12760ae44886 (patch) | |
tree | 3f4f8b1fb6779459f40744d63bff66f6c39ddb17 /Build/source/texk/ptexenc/unicode.c | |
parent | 060a4a92a5be26cffc2f312b3a1de08c670596fb (diff) |
ptexenc update from Takuji Tanaka
git-svn-id: svn://tug.org/texlive/trunk@23744 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ptexenc/unicode.c')
-rw-r--r-- | Build/source/texk/ptexenc/unicode.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Build/source/texk/ptexenc/unicode.c b/Build/source/texk/ptexenc/unicode.c index be8768964e3..3fb90da913a 100644 --- a/Build/source/texk/ptexenc/unicode.c +++ b/Build/source/texk/ptexenc/unicode.c @@ -32,7 +32,7 @@ boolean isUTF8(int length, int nth, int c) int UTF8length(int first_byte) { - if (first_byte < 0x00) return -2; /* illegal */ + first_byte &= 0xff; if (first_byte < 0x80) return 1; if (first_byte < 0xc2) return -2; /* illegal */ if (first_byte < 0xe0) return 2; @@ -119,13 +119,12 @@ long UCStoUTF8(long ucs) /* using over U+10.FFFF Area */ long UCStoUPTEX (long ucs) { - if (0x7F < ucs && ucs < 0x1000) ucs += UCS_MAX; return ucs; } /* using over U+10.FFFF Area */ long UPTEXtoUCS (long uptex) { - if (UCS_MAX + 0x7F < uptex && uptex < UCS_MAX + 0x1000) uptex -= UCS_MAX; + if (uptex>UCS_MAX) return uptex % UCS_MAX; /* for OTF package */ return uptex; } |