uni2utf8path

Converts a path from Unicode to UTF-8, using the special semantics of file system paths.

Library:LibC
Service:Characters and Strings

Syntax

  #include <unilib.h> 
   
  int uni2utf8path (
     char              *dest,
     const unicode_t   *src,
     size_t            *dryRunSize);
  

Parameters

dest

(OUT) Points to the converted path.

src

(IN) Points to the source path to use in the conversion.

dryRunSize

(IN) Indicates whether to perform the conversion or merely compute the size of the converted string:

  • To perform the conversion, pass NULL.

  • To calculate the size of the converted string, pass the address of a variable of type size_t. The function returns in this parameter the number of characters that would be consumed in dest if the function were to perform the actual conversion. No conversion is performed. The count includes only the number of characters and does not include any null-terminating characters

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