Mercurial > emacs
comparison src/coding.c @ 22723:04b653d7f842
(code_convert_string): Count characters again if we
encounter some invalid code while decoding.
| author | Kenichi Handa <handa@m17n.org> |
|---|---|
| date | Thu, 09 Jul 1998 04:33:00 +0000 |
| parents | 3e3949ac4cfb |
| children | 7ab6c2f70b0b |
comparison
equal
deleted
inserted
replaced
| 22722:ef426e5873e3 | 22723:04b653d7f842 |
|---|---|
| 4431 | 4431 |
| 4432 len = from + STRING_BYTES (XSTRING (str)) - to_byte; | 4432 len = from + STRING_BYTES (XSTRING (str)) - to_byte; |
| 4433 if (encodep) | 4433 if (encodep) |
| 4434 str = make_unibyte_string (buf, len + coding->produced); | 4434 str = make_unibyte_string (buf, len + coding->produced); |
| 4435 else | 4435 else |
| 4436 str = make_string_from_bytes (buf, len + coding->produced_char, | 4436 { |
| 4437 len + coding->produced); | 4437 int chars= (coding->fake_multibyte |
| 4438 ? multibyte_chars_in_text (buf + from, coding->produced) | |
| 4439 : coding->produced_char); | |
| 4440 str = make_multibyte_string (buf, len + chars, len + coding->produced); | |
| 4441 } | |
| 4442 | |
| 4438 return str; | 4443 return str; |
| 4439 } | 4444 } |
| 4440 | 4445 |
| 4441 | 4446 |
| 4442 #ifdef emacs | 4447 #ifdef emacs |
