{
unsigned int s1, s2;
#ifdef UTF2000
- int code_point = charset_code_point (Vcharset_latin_jisx0201, ch);
+ int code_point = charset_code_point (Vcharset_latin_jisx0201, ch, 0);
if (code_point >= 0)
Dynarr_add (dst, code_point);
else if ((code_point
- = charset_code_point (Vcharset_japanese_jisx0208_1990, ch))
+ = charset_code_point (Vcharset_japanese_jisx0208_1990, ch, 0))
>= 0)
{
ENCODE_SJIS ((code_point >> 8) | 0x80,
Dynarr_add (dst, s2);
}
else if ((code_point
- = charset_code_point (Vcharset_katakana_jisx0201, ch))
+ = charset_code_point (Vcharset_katakana_jisx0201, ch, 0))
>= 0)
Dynarr_add (dst, code_point | 0x80);
else if ((code_point
- = charset_code_point (Vcharset_japanese_jisx0208, ch))
+ = charset_code_point (Vcharset_japanese_jisx0208, ch, 0))
>= 0)
{
ENCODE_SJIS ((code_point >> 8) | 0x80,
Dynarr_add (dst, s1);
Dynarr_add (dst, s2);
}
- else if ((code_point = charset_code_point (Vcharset_ascii, ch))
+ else if ((code_point = charset_code_point (Vcharset_ascii, ch, 0))
>= 0)
Dynarr_add (dst, code_point);
else
Lisp_Object ccs
= CODING_SYSTEM_ISO2022_INITIAL_CHARSET (str->codesys, 1);
- if ((code_point = charset_code_point (Vcharset_ascii, ch)) >= 0)
+ if ((code_point = charset_code_point (Vcharset_ascii, ch, 0)) >= 0)
Dynarr_add (dst, code_point);
- else if ((code_point = charset_code_point (ccs, ch)) >= 0)
+ else if ((code_point = charset_code_point (ccs, ch, 0)) >= 0)
{
Dynarr_add (dst, code_point >> 8);
Dynarr_add (dst, code_point & 0xFF);
}
else if ((code_point
- = charset_code_point (Vcharset_chinese_big5, ch)) >= 0)
+ = charset_code_point (Vcharset_chinese_big5, ch, 0)) >= 0)
{
Dynarr_add (dst, code_point >> 8);
Dynarr_add (dst, code_point & 0xFF);
}
else if ((code_point
- = charset_code_point (Vcharset_chinese_big5_1, ch)) >= 0)
+ = charset_code_point (Vcharset_chinese_big5_1, ch, 0)) >= 0)
{
unsigned int I
= ((code_point >> 8) - 33) * (0xFF - 0xA1)
Dynarr_add (dst, b2);
}
else if ((code_point
- = charset_code_point (Vcharset_chinese_big5_2, ch)) >= 0)
+ = charset_code_point (Vcharset_chinese_big5_2, ch, 0)) >= 0)
{
unsigned int I
= ((code_point >> 8) - 33) * (0xFF - 0xA1)
{
if ( c < ' ' )
{
+ COMPOSE_FLUSH_CHARS (str, dst);
decode_flush_er_chars (str, dst);
DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
DECODE_ADD_UCS_CHAR (c, dst);
}
else if ( c < 0xC0 )
- decode_add_er_char (str, c, dst);
+ /* decode_add_er_char (str, c, dst); */
+ COMPOSE_ADD_CHAR (str, c, dst);
else
{
- decode_flush_er_chars (str, dst);
+ /* decode_flush_er_chars (str, dst); */
if ( c < 0xE0 )
{
cpos = c & 0x1f;
cpos = ( cpos << 6 ) | ( c & 0x3f );
if (counter == 1)
{
- DECODE_ADD_UCS_CHAR (cpos, dst);
+ /* DECODE_ADD_UCS_CHAR (cpos, dst); */
+ COMPOSE_ADD_CHAR (str, cpos, dst);
cpos = 0;
counter = 0;
}
}
else
{
+ COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
decode_output_utf8_partial_char (counter, cpos, dst);
DECODE_ADD_BINARY_CHAR (c, dst);
cpos = 0;
if (flags & CODING_STATE_END)
{
+ COMPOSE_FLUSH_CHARS (str, dst);
decode_flush_er_chars (str, dst);
if (counter > 0)
{
}
else
{
- int code_point = charset_code_point (Vcharset_ucs, ch);
+ int code_point = charset_code_point (Vcharset_ucs, ch, 0);
if ( (code_point < 0) || (code_point > 0x10FFFF) )
{
if (!NILP (ccs = Ffind_charset (ccs)))
{
if ( (code_point
- = charset_code_point (ccs, ch)) >= 0 )
+ = charset_code_point (ccs, ch, 0)) >= 0 )
{
cell = Fcdr (cell);
ret = Fcar (cell);
case ISO_ESC_LITERAL:
COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
DECODE_ADD_BINARY_CHAR (c, dst);
break;
/* Output the (possibly invalid) sequence */
int i;
COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
for (i = 0; i < str->iso2022.esc_bytes_index; i++)
DECODE_ADD_BINARY_CHAR (str->iso2022.esc_bytes[i], dst);
flags &= CODING_STATE_ISO2022_LOCK;
escape sequence; it could mess things up anyway.
Just add it now. */
COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
DECODE_ADD_BINARY_CHAR (c, dst);
}
}
if (counter)
{
COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
while (counter > 0)
{
counter--;
if (flags & CODING_STATE_SS2)
{
COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
DECODE_ADD_BINARY_CHAR (ISO_CODE_SS2, dst);
flags &= ~CODING_STATE_SS2;
}
if (flags & CODING_STATE_SS3)
{
COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
DECODE_ADD_BINARY_CHAR (ISO_CODE_SS3, dst);
flags &= ~CODING_STATE_SS3;
}
if (c == '\r')
{
COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
if (eol_type == EOL_CR)
Dynarr_add (dst, '\n');
else if (eol_type != EOL_CRLF || flags & CODING_STATE_CR)
if (!parse_iso2022_esc (coding_system, &str->iso2022, c, &flags, 1))
{
COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
DECODE_ADD_BINARY_CHAR (c, dst);
}
}
if (c == '\r')
{
COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
if (eol_type == EOL_CR)
Dynarr_add (dst, '\n');
else if (eol_type != EOL_CRLF || flags & CODING_STATE_CR)
to preserve it for the output. */
{
COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
while (counter > 0)
{
counter--;
if (flags & CODING_STATE_END)
{
COMPOSE_FLUSH_CHARS (str, dst);
+ decode_flush_er_chars (str, dst);
DECODE_OUTPUT_PARTIAL_CHAR (cpos);
}
str->flags = flags;
for (i = 0; i < 4; i++)
{
if ((CHARSETP (charset = str->iso2022.charset[i])
- && ((code_point = charset_code_point (charset, ch)) >= 0))
+ && ((code_point = charset_code_point (charset, ch, 0)) >= 0))
||
(CHARSETP
(charset
= CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i))
- && ((code_point = charset_code_point (charset, ch)) >= 0)))
+ && ((code_point = charset_code_point (charset, ch, 0)) >= 0)))
{
reg = i;
break;