UniToUtf8Size

Computes the number of bytes that must be allocated to convert a string from Unicode to UTF-8.

Library:LibC
Service:Characters and Strings

Syntax

  #include <unilib.h> 
   
  int UniToUtf8Size (
     const unicode_t   *str,
     size_t            *utf8BufSize);
  

Parameters

str

(IN) Points to the Unicode source string.

utf8BufSize

(OUT) Returns the number of bytes required for the string in UTF-8 format, minus the null terminator.

Return Values

If successful, returns 0. Otherwise, returns a negative error code:

Decimal

Name

Description

-532

UNI_ERR_UNMAPPABLE_CHAR

A character in the source is unmappable.

See Also