Perform code-set conversion

For a multibyte-character string, the size of the converted string might not equal the size of the unconverted string. Therefore, to perform code-set conversion on multibyte characters, you must take the following special processing steps:
  • Determine whether you need to allocate a separate destination buffer; if a destination buffer is needed, determine its size.
  • Preserve state information for multiple fragments of a multibyte string.