diff options
| author | Kenichi Handa | 2004-04-20 02:46:38 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2004-04-20 02:46:38 +0000 |
| commit | f03caae0b7d660cc6389d0ff0aa8693d02a4c31e (patch) | |
| tree | d34cb8affb78bf00b32b788589c18097ce84339b /src/coding.c | |
| parent | 21e9972913d3094ee122ef0dbe931d70bdde7c1c (diff) | |
| download | emacs-f03caae0b7d660cc6389d0ff0aa8693d02a4c31e.tar.gz emacs-f03caae0b7d660cc6389d0ff0aa8693d02a4c31e.zip | |
(encode_coding_utf_8): Fix handling of raw-byte char.
(consume_chars): Fix handling of 8-bit bytes in unibyte source.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/coding.c b/src/coding.c index ccaa408b600..7f9ba05813c 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -1349,7 +1349,10 @@ encode_coding_utf_8 (coding) | |||
| 1349 | { | 1349 | { |
| 1350 | ASSURE_DESTINATION (safe_room); | 1350 | ASSURE_DESTINATION (safe_room); |
| 1351 | c = *charbuf++; | 1351 | c = *charbuf++; |
| 1352 | dst += CHAR_STRING (c, dst); | 1352 | if (CHAR_BYTE8_P (c)) |
| 1353 | *dst++ = CHAR_TO_BYTE8 (c); | ||
| 1354 | else | ||
| 1355 | dst += CHAR_STRING (c, dst); | ||
| 1353 | produced_chars++; | 1356 | produced_chars++; |
| 1354 | } | 1357 | } |
| 1355 | } | 1358 | } |
| @@ -6379,11 +6382,10 @@ consume_chars (coding, translation_table, max_lookup) | |||
| 6379 | { | 6382 | { |
| 6380 | EMACS_INT bytes; | 6383 | EMACS_INT bytes; |
| 6381 | 6384 | ||
| 6382 | if (! CODING_FOR_UNIBYTE (coding) | 6385 | if ((bytes = MULTIBYTE_LENGTH (src, src_end)) > 0) |
| 6383 | && (bytes = MULTIBYTE_LENGTH (src, src_end)) > 0) | ||
| 6384 | c = STRING_CHAR_ADVANCE (src), pos += bytes; | 6386 | c = STRING_CHAR_ADVANCE (src), pos += bytes; |
| 6385 | else | 6387 | else |
| 6386 | c = *src++, pos++; | 6388 | c = BYTE8_TO_CHAR (*src), src++, pos++; |
| 6387 | } | 6389 | } |
| 6388 | else | 6390 | else |
| 6389 | c = STRING_CHAR_ADVANCE (src), pos++; | 6391 | c = STRING_CHAR_ADVANCE (src), pos++; |