From: Kenichi Handa Date: Thu, 9 Jul 1998 04:33:00 +0000 (+0000) Subject: (code_convert_string): Count characters again if we X-Git-Tag: emacs-20.3~356 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=826bfb8b08ae740696cfd0c55fb40c6ee9a5d14b;p=emacs.git (code_convert_string): Count characters again if we encounter some invalid code while decoding. --- diff --git a/src/coding.c b/src/coding.c index 81fda21f1cb..d865bd139bf 100644 --- a/src/coding.c +++ b/src/coding.c @@ -4433,8 +4433,13 @@ code_convert_string (str, coding, encodep, nocopy) if (encodep) str = make_unibyte_string (buf, len + coding->produced); else - str = make_string_from_bytes (buf, len + coding->produced_char, - len + coding->produced); + { + int chars= (coding->fake_multibyte + ? multibyte_chars_in_text (buf + from, coding->produced) + : coding->produced_char); + str = make_multibyte_string (buf, len + chars, len + coding->produced); + } + return str; }