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:
dst multibyte destination buffer
dst_len multibyte destination buffer size
srcp address 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:
dst wide-char destination buffer
dst_len wide-char destination buffer size
srcp address 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:
s the 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_string the wide-char string
len the len of the wide-char string
Returns:
1 if the main direction is right-to-left, 0 otherwise

Generated on 7 Jan 2014 for libgpac by  doxygen 1.6.1