summaryrefslogtreecommitdiff
path: root/iconvdata/uhc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-04-25 20:34:34 +0000
committerUlrich Drepper <drepper@redhat.com>1998-04-25 20:34:34 +0000
commit918b9d72a9980efd4622bd25506da9531a952dbe (patch)
treef45368136155cd1ef156aaf277047a5488b9c3ac /iconvdata/uhc.c
parent05c9fa3c0511214e808ec048f1062540dc243eb9 (diff)
Update.
1998-04-25 18:39 Ulrich Drepper <drepper@cygnus.com> * iconvdata/Makefile: Use gap method for iso8859-5, iso8859-7, iso8859-8 and iso8859-10. * iconvdata/iso8859-5.c: Change to use gap method. * iconvdata/iso8859-7.c: Likewise. * iconvdata/iso8859-8.c: Likewise. * iconvdata/iso8859-10.c: Likewise. * iconvdata/Makefile: Add rules for ISO-2022-JP module. * iconv/skeleton.c: Allow END_LOOP do be defined and use it at the end of the loop. * iconvdata/iso-2022-jp.c: New file. * iconvdata/ksc5601.c: Don't use uint16_t to represent byte sequence. * iconvdata/ksc5601.h: Unify function interfaces. * iconvdata/euckr.c: Adapt for changed ksc5601.h interface. * iconvdata/uhc.c: Likewise. * iconvdata/gb2312.h: Use correct types. * iconvdata/iso646.c (gconv_open): Correctly initialize the character size elements of data.
Diffstat (limited to 'iconvdata/uhc.c')
-rw-r--r--iconvdata/uhc.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/iconvdata/uhc.c b/iconvdata/uhc.c
index 9c0b668ff7..0d09f4a092 100644
--- a/iconvdata/uhc.c
+++ b/iconvdata/uhc.c
@@ -2689,11 +2689,19 @@ uhc_from_ucs4 (uint32_t ch, unsigned char *cp)
+ (ch < 0xa1 \
? (ch - 0x81) * 178 \
: 5696 + (ch - 0xa1) * 84)]; \
+ \
+ if (ch == 0) \
+ { \
+ /* This is an illegal character. */ \
+ result = GCONV_ILLEGAL_INPUT; \
+ break; \
+ } \
+ \
+ inptr += 2; \
} \
else \
{ \
- ch = ksc5601_to_ucs4 ((ch * 256 + ch2) & 0x7f7f); \
- \
+ ch = ksc5601_to_ucs4 (&inptr, 2, 0x80);
if (ch == UNKNOWN_10646_CHAR) \
{ \
/* Illegal. */ \
@@ -2701,15 +2709,6 @@ uhc_from_ucs4 (uint32_t ch, unsigned char *cp)
break; \
} \
} \
- \
- if (ch == 0) \
- { \
- /* This is an illegal character. */ \
- result = GCONV_ILLEGAL_INPUT; \
- break; \
- } \
- \
- inptr += 2; \
} \
\
*((uint32_t *) outptr)++ = ch; \