liba 0.1.15
An algorithm library based on C/C++
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Loading...
Searching...
No Matches
Unicode Transformation Format
Collaboration diagram for Unicode Transformation Format:

Functions

unsigned int a_utf_encode (a_u32 val, void *buf)
 encode one unicode code point into UTF-8
 
unsigned int a_utf_decode (void const *ptr, a_size num, a_u32 *val)
 decode one unicode code point from UTF-8
 
a_size a_utf_length (void const *ptr, a_size num, a_size *stop)
 number of unicode code points in a UTF-8 encoded byte sequence
 
a_size a_utf_length_ (void const *ptr, a_size num)
 

Detailed Description

Function Documentation

◆ a_utf_decode()

unsigned int a_utf_decode ( void const * ptr,
a_size num,
a_u32 * val )

decode one unicode code point from UTF-8

Parameters
[in]ptrpoints to the buffer containing the UTF-8 byte
[in]numnumber of the buffer containing the UTF-8 byte
[out]valstore the unicode code point
  • 0 don't return the unicode code point
Returns
offset to the next character
Return values
0null character or invalid

◆ a_utf_encode()

unsigned int a_utf_encode ( a_u32 val,
void * buf )

encode one unicode code point into UTF-8

Parameters
[in]valthe unicode code point to be encoded
[in]bufa buffer to store a UTF-8 character
Returns
number of bytes used in the UTF-8 encoding

◆ a_utf_length()

a_size a_utf_length ( void const * ptr,
a_size num,
a_size * stop )

number of unicode code points in a UTF-8 encoded byte sequence

Parameters
[in]ptrpoints to the buffer containing the UTF-8 byte
[in]numnumber of the buffer containing the UTF-8 byte
[out]stopstore the number of consumed bytes
  • 0 don't return the number of consumed bytes
Returns
number of unicode code points