unin2utf8

Converts a string from Unicode to UTF-8.

Library:LibC
Service:Characters and Strings

Syntax

  #include <unilib.h> 
   
  int unin2utf8 (
     char              *dest,
     size_t            *destLen,
     const unicode_t   *src
     size_t             srcLen);
  

Parameters

dest

(OUT) Points to the converted string.

destLen

(IN/OUT) Points to the maximum number of UTF-8 characters that the destination string can hold when the function is called. When the function returns, it contains the number of UTF-8 characters in the converted string.

src

(IN) Points to the source string.

srcLen

(IN) Specifies the number of Unicode characters in the source string.

Return Values

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

Decimal

Name

Description

-532

UNI_ERR_UNMAPPABLE_CHAR

The source contains an unmappable character.

See Also