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

utf8towc.c File Reference

#include "unicode.h"

Functions

int unicode_utf8len (int lead_byte)
 Gets the length of a UTF-8 character.
int unicode_utf8towc (wchar_t *restrict result, const char *restrict string, size_t size)
 UTF-8 to wide character.

Variables

struct {
   uint8_t   mask
   uint8_t   val
t [4]

Function Documentation

int unicode_utf8len int  lead_byte  ) 
 

Gets the length of a UTF-8 character.

Parameters:
lead_byte the first byte of a UTF-8 character;
Return values:
>0 the length in bytes of the UTF-8 character;
-EILSEQ invalid UTF-8 lead byte;
Remarks:
For performance reasons, this function does not parse the whole UTF-8 byte sequence, just the first byte. If checking the validity of the whole UTF-8 byte sequence is needed, use unicode_utf8towc.

int unicode_utf8towc wchar_t *restrict  result,
const char *restrict  string,
size_t  size
 

UTF-8 to wide character.

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


Variable Documentation

uint8_t mask
 

struct { ... } t[4] [static]
 

uint8_t val
 


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