summaryrefslogtreecommitdiff
path: root/src/coding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c9
1 files changed, 7 insertions, 2 deletions
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;
}