loc2unipath

Converts a path from local code page to Unicode, using the special semantics of file system paths.

Library:LibC
Service:Characters and Strings

Syntax

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

Parameters

table

(IN) Specifies the table to use in the conversion. To use the host's default code page, specify UNI_LOCAL_DEFAULT. Otherwise, specify the value returned from the UniGetTable function.

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

-496

UNI_ERR_BAD_HANDLE

The table parameter specifies a nonexistent rule table.

-532

UNI_ERR_UNMAPPABLE_CHAR

A character in the source path is unmappable.

See Also