Commit fb4452cc authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(string_to_multibyte): Always return a multibyte string.

parent f0d73ec4
2003-02-17 Kenichi Handa <>
* fns.c (string_to_multibyte): Always return a multibyte string.
2003-02-16 Jason Rumney <> 2003-02-16 Jason Rumney <>
* w32fns.c (w32_list_bdf_fonts, w32_list_fonts): Negative * w32fns.c (w32_list_bdf_fonts, w32_list_fonts): Negative
...@@ -1053,10 +1053,10 @@ string_to_multibyte (string) ...@@ -1053,10 +1053,10 @@ string_to_multibyte (string)
return string; return string;
nbytes = parse_str_to_multibyte (SDATA (string), SBYTES (string)); nbytes = parse_str_to_multibyte (SDATA (string), SBYTES (string));
/* If all the chars are ASCII, they won't need any more bytes /* If all the chars are ASCII or eight-bit-graphic, they won't need
once converted. In that case, we can return STRING itself. */ any more bytes once converted. */
if (nbytes == SBYTES (string)) if (nbytes == SBYTES (string))
return string; return make_multibyte_string (SDATA (string), nbytes, nbytes);
buf = (unsigned char *) alloca (nbytes); buf = (unsigned char *) alloca (nbytes);
bcopy (SDATA (string), buf, SBYTES (string)); bcopy (SDATA (string), buf, SBYTES (string));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment