Main Page | Modules | Namespace List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

utf16towc.c File Reference

#include "unicode.h"

Functions

int unicode_utf16len (int lead_word)
 Gets the length of a UTF-16 character.
int unicode_utf16towc (wchar_t *restrict result, const uint16_t *restrict string, size_t size)
 UTF-16 to wide character.

Function Documentation

int unicode_utf16len int  lead_word  ) 
 

Gets the length of a UTF-16 character.

Parameters:
lead_word the first uint16_t of a UTF-16 character;
Return values:
>0 the length in uint16_t units of the UTF-16 character;
Remarks:
For performance reasons, this function does not parse the whole UTF-16 word sequence, just the first uint16_t. If checking the validity of the whole UTF-16 word sequence is needed, use unicode_utf16towc.

int unicode_utf16towc wchar_t *restrict  result,
const uint16_t *restrict  string,
size_t  size
 

UTF-16 to wide character.

Parameters:
result where to store the converted wide character;
string buffer containing the UTF-16 character to convert;
size max number of uint16_t units of string to examine;
Return values:
>0 the length in uint16_t units of the processed UTF-16 character, the wide character is stored in result;
-EILSEQ invalid UTF-16 word sequence;
-ENAMETOOLONG size too small to parse the UTF-16 character.


Generated on Fri Feb 24 14:13:22 2006 for VDK Blacksheep by  doxygen 1.4.1