diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-12-16 14:50:11 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-12-16 14:50:11 +0000 |
commit | 621273b5ef8cc9e83d9aca07bf012f727ba26f15 (patch) | |
tree | 0b5cb28eec37e3e0e93a09729cbc30834166a5f9 /Build/source/texk/web2c/luatexdir/utils/unistring.w | |
parent | f04f01782aebac8cb2fcde278c02a4fb3be4bb12 (diff) |
web2c/luatexdir: LuaTeX beta-0.86.0 (Sync with the upstream).
git-svn-id: svn://tug.org/texlive/trunk@39116 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/utils/unistring.w')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/utils/unistring.w | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Build/source/texk/web2c/luatexdir/utils/unistring.w b/Build/source/texk/web2c/luatexdir/utils/unistring.w index 3e8d82d0c1d..a5b365a5f2e 100644 --- a/Build/source/texk/web2c/luatexdir/utils/unistring.w +++ b/Build/source/texk/web2c/luatexdir/utils/unistring.w @@ -64,9 +64,9 @@ unsigned str2uni(const unsigned char *k) *text >= 0xc0 || text[1] >= 0xc0 || text[2] >= 0xc0) val = 0xFFFD; } else { - /* the 5- and 6-byte UTF-8 sequences generate integers + /* the 5- and 6-byte UTF-8 sequences generate integers that are outside of the valid UCS range, and therefore - unsupported + unsupported */ } if (val == 0xFFFD) @@ -74,7 +74,7 @@ unsigned str2uni(const unsigned char *k) return (val); } -@ This is a very basic helper +@ This is a very basic helper @c unsigned char *uni2str(unsigned unic) { @@ -92,12 +92,11 @@ unsigned char *uni2str(unsigned unic) *pt++ = (unsigned char) (0x80 | ((unic >> 6) & 0x3f)); *pt++ = (unsigned char) (0x80 | (unic & 0x3f)); } else { - int u, z, y, x; unsigned val = unic - 0x10000; - u = (int) (((val & 0xf0000) >> 16) + 1); - z = (int) ((val & 0x0f000) >> 12); - y = (int) ((val & 0x00fc0) >> 6); - x = (int) (val & 0x0003f); + int u = (int) (((val & 0xf0000) >> 16) + 1); + int z = (int) ((val & 0x0f000) >> 12); + int y = (int) ((val & 0x00fc0) >> 6); + int x = (int) (val & 0x0003f); *pt++ = (unsigned char) (0xf0 | (u >> 2)); *pt++ = (unsigned char) (0x80 | ((u & 3) << 4) | z); *pt++ = (unsigned char) (0x80 | y); @@ -109,7 +108,7 @@ unsigned char *uni2str(unsigned unic) @ |buffer_to_unichar| converts a sequence of bytes in the |buffer| into a unicode character value. It does not check for overflow -of the |buffer|, but it is careful to check the validity of the +of the |buffer|, but it is careful to check the validity of the UTF-8 encoding. @c @@ -120,7 +119,7 @@ int buffer_to_unichar(int k) @ These came from texlang.w -@c +@c char *uni2string(char *utf8_text, unsigned ch) { /* Increment and deposit character */ |