utf82chr

Converts a UTF-8 character to an ASCII character.

Library:LibC
Service:Characters and Strings

Syntax

  #include <unilib.h> 
   
  int utf82chr (
     UniRuleTable_t   handle,
     char            *dest,
     const char      *src,
     int             *used );
  

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 address of the converted character, which is null terminated.

src

(IN) Points to the source character. This character does not need to be null terminated.

used

(OUT) Points to the number of bytes in the UTF-8 character that was converted.

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