charset = new_charset;
}
-#ifndef UTF2000
+#ifdef UTF2000
+ if (XCHARSET_DIMENSION (charset) == 1)
+ {
+ DECODE_OUTPUT_PARTIAL_CHAR (ch);
+ DECODE_ADD_UCS_CHAR
+ (MAKE_CHAR (charset, c & 0x7F, 0), dst);
+ }
+ else if (ch)
+ {
+ DECODE_ADD_UCS_CHAR
+ (MAKE_CHAR (charset, ch & 0x7F, c & 0x7F), dst);
+ ch = 0;
+ }
+ else
+ ch = c;
+#else
lb = XCHARSET_LEADING_BYTE (charset);
-#endif
switch (XCHARSET_REP_BYTES (charset))
{
case 1: /* ASCII */
case 2: /* one-byte official */
DECODE_OUTPUT_PARTIAL_CHAR (ch);
-#ifdef UTF2000
- DECODE_ADD_UCS_CHAR(MAKE_CHAR(charset, c & 0x7F, 0), dst);
-#else
Dynarr_add (dst, lb);
Dynarr_add (dst, c | 0x80);
-#endif
break;
case 3: /* one-byte private or two-byte official */
-#ifdef UTF2000
- if (XCHARSET_DIMENSION (charset) == 1)
-#else
if (XCHARSET_PRIVATE_P (charset))
-#endif
{
DECODE_OUTPUT_PARTIAL_CHAR (ch);
-#ifdef UTF2000
- DECODE_ADD_UCS_CHAR(MAKE_CHAR(charset, c & 0x7F, 0),
- dst);
-#else
Dynarr_add (dst, PRE_LEADING_BYTE_PRIVATE_1);
Dynarr_add (dst, lb);
Dynarr_add (dst, c | 0x80);
-#endif
}
else
{
if (ch)
{
-#ifdef UTF2000
- DECODE_ADD_UCS_CHAR(MAKE_CHAR(charset,
- ch & 0x7F,
- c & 0x7F), dst);
-#else
Dynarr_add (dst, lb);
Dynarr_add (dst, ch | 0x80);
Dynarr_add (dst, c | 0x80);
-#endif
ch = 0;
}
else
default: /* two-byte private */
if (ch)
{
-#ifdef UTF2000
- DECODE_ADD_UCS_CHAR(MAKE_CHAR(charset,
- ch & 0x7F,
- c & 0x7F), dst);
-#else
Dynarr_add (dst, PRE_LEADING_BYTE_PRIVATE_2);
Dynarr_add (dst, lb);
Dynarr_add (dst, ch | 0x80);
Dynarr_add (dst, c | 0x80);
-#endif
ch = 0;
}
else
ch = c;
}
+#endif
}
if (!ch)