diff options
Diffstat (limited to 'src')
| -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++; |