Function: string-to-multibyte

string-to-multibyte is a function defined in fns.c.

Signature

(string-to-multibyte STRING)

Documentation

Return a multibyte string with the same individual chars as STRING.

If STRING is multibyte, the result is STRING itself. Otherwise it is a newly created string, with no text properties.

If STRING is unibyte and contains an 8-bit byte, it is converted to the corresponding multibyte character of charset eight-bit.

This differs from string-as-multibyte by converting each byte of a correct utf-8 sequence to an eight-bit character, not just bytes that don't form a correct sequence.

Probably introduced at or before Emacs version 22.1.

Source Code

// Defined in /usr/src/emacs/src/fns.c
{
  CHECK_STRING (string);

  return string_to_multibyte (string);
}