Utf8ToUniSize

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

Library:LibC
Service:Characters and Strings

Syntax

  #include <unilib.h> 
   
  int Utf8ToUniSize (
     const char   *str,
     size_t       *uniBufSize);
  

Parameters

str

(IN) Points to the source string.

uniBufSize

(OUT) Returns the number of bytes required for the string in Unicode, 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

UniToUtf8Size