Unicode 3.2 support (7), JISX0213 converter
Bruno Haible
haible@ilog.fr
Mon Apr 22 05:04:00 GMT 2002
Oops, there is a little bug in the new converters: Unicode tag characters
are not ignored, as they should be.
2002-04-20 Bruno Haible <bruno@clisp.org>
* iconvdata/euc-jisx0213.c (BODY for TO_LOOP): Really ignore Unicode
tag characters.
* iconvdata/shift_jisx0213.c (BODY for TO_LOOP): Likewise.
--- glibc-20020408/iconvdata/euc-jisx0213.c.bakkk Thu Apr 18 00:07:35 2002
+++ glibc-20020408/iconvdata/euc-jisx0213.c Sat Apr 20 21:50:08 2002
@@ -366,8 +366,8 @@
} \
else \
{ \
- ch = ucs4_to_jisx0213 (ch); \
- if (ch == 0) \
+ uint32_t jch = ucs4_to_jisx0213 (ch); \
+ if (jch == 0) \
{ \
UNICODE_TAG_HANDLER (ch, 4); \
\
@@ -375,19 +375,19 @@
STANDARD_ERR_HANDLER (4); \
} \
\
- if (ch & 0x0080) \
+ if (jch & 0x0080) \
{ \
/* A possible match in comp_table_data. We have to buffer it. */\
\
/* We know it's a JISX 0213 plane 1 character. */ \
- assert ((ch & 0x8000) == 0); \
+ assert ((jch & 0x8000) == 0); \
\
- *statep = (ch | 0x8080) << 3; \
+ *statep = (jch | 0x8080) << 3; \
inptr += 4; \
continue; \
} \
\
- if (ch & 0x8000) \
+ if (jch & 0x8000) \
{ \
/* JISX 0213 plane 2. */ \
if (__builtin_expect (outptr + 2 >= outend, 0)) \
@@ -406,8 +406,8 @@
break; \
} \
} \
- *outptr++ = (ch >> 8) | 0x80; \
- *outptr++ = (ch & 0xff) | 0x80; \
+ *outptr++ = (jch >> 8) | 0x80; \
+ *outptr++ = (jch & 0xff) | 0x80; \
} \
\
inptr += 4; \
--- glibc-20020408/iconvdata/shift_jisx0213.c.bakkk Thu Apr 18 00:13:23 2002
+++ glibc-20020408/iconvdata/shift_jisx0213.c Sat Apr 20 21:50:54 2002
@@ -352,9 +352,8 @@
else \
{ \
unsigned int s1, s2; \
- \
- ch = ucs4_to_jisx0213 (ch); \
- if (ch == 0) \
+ uint32_t jch = ucs4_to_jisx0213 (ch); \
+ if (jch == 0) \
{ \
UNICODE_TAG_HANDLER (ch, 4); \
\
@@ -363,8 +362,8 @@
} \
\
/* Convert it to shifted representation. */ \
- s1 = ch >> 8; \
- s2 = ch & 0x7f; \
+ s1 = jch >> 8; \
+ s2 = jch & 0x7f; \
s1 -= 0x21; \
s2 -= 0x21; \
if (s1 >= 0x5e) \
@@ -390,12 +389,12 @@
else \
s2 += 0x41; \
\
- if (ch & 0x0080) \
+ if (jch & 0x0080) \
{ \
/* A possible match in comp_table_data. We have to buffer it. */\
\
/* We know it's a JISX 0213 plane 1 character. */ \
- assert ((ch & 0x8000) == 0); \
+ assert ((jch & 0x8000) == 0); \
\
*statep = ((s1 << 8) | s2) << 3; \
inptr += 4; \
More information about the Libc-alpha
mailing list