(code_convert_string): Count characters again if we
encounter some invalid code while decoding.
This commit is contained in:
parent
973cefd24a
commit
826bfb8b08
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue