libgpac  0.5.0
Functions
UTF
utils

UTF encoding functions. More...

Functions

size_t gf_utf8_wcstombs (char *dst, size_t dst_len, const unsigned short **srcp)
 wide-char to multibyte conversion
 
size_t gf_utf8_mbstowcs (unsigned short *dst, size_t dst_len, const char **srcp)
 multibyte to wide-char conversion
 
size_t gf_utf8_wcslen (const unsigned short *s)
 wide-char string length
 
Bool gf_utf8_reorder_bidi (u16 *utf_string, u32 len)
 string bidi reordering
 

Detailed Description

*This section documents the UTF functions of the GPAC framework.
*The wide characters in GPAC are unsignad shorts, in other words GPAC only supports UTF8 and UTF16 coding styles.

Note
these functions are just ports of libutf8 library tools into GPAC.

Function Documentation

size_t gf_utf8_wcstombs ( char *  dst,
size_t  dst_len,
const unsigned short **  srcp 
)

*Converts a wide-char string to a multibyte string

Parameters
dstmultibyte destination buffer
dst_lenmultibyte destination buffer size
srcpaddress of the wide-char string. This will be set to the next char to be converted in the input buffer if not enough space in the destination, or NULL if conversion was completed.
Returns
length (in byte) of the multibyte string or -1 if error.
size_t gf_utf8_mbstowcs ( unsigned short *  dst,
size_t  dst_len,
const char **  srcp 
)

*Converts a multibyte string to a wide-char string

Parameters
dstwide-char destination buffer
dst_lenwide-char destination buffer size
srcpaddress of the multibyte character buffer. This will be set to the next char to be converted in the input buffer if not enough space in the destination, or NULL if conversion was completed.
Returns
length (in unsigned short) of the wide-char string or -1 if error.
size_t gf_utf8_wcslen ( const unsigned short *  s)

*Returns the length in character of a wide-char string

Parameters
sthe wide-char string
Returns
the wide-char string length
Bool gf_utf8_reorder_bidi ( u16 *  utf_string,
u32  len 
)

*Performs a simple reordering of words in the string based on each word direction, so that glyphs are sorted in display order.

Parameters
utf_stringthe wide-char string
lenthe len of the wide-char string
Returns
1 if the main direction is right-to-left, 0 otherwise