Unicode handling


Functions

const UTF8CHARutf8_next_char (const UTF8CHAR *in)
 Finds the next UTF-8 character in the string after in.
UTFCHAR * utf8_to_utf16be (iml_session_t *s, const UTF8CHAR *utf8, unsigned int *num_chars)
 Converts a string from UTF-8 to UTF-16BE.
UTF32CHARutf8_to_utf32 (iml_session_t *s, const UTF8CHAR *utf8, unsigned int *num_chars)
 Converts a string from UTF-8 to UTF-32.
UTF8CHARutf32_to_utf8 (iml_session_t *s, const UTF32CHAR *utf32, unsigned int *num_chars)
 Converts a string from UTF-32 to UTF-8.
UTF8CHARutf16be_to_utf8 (iml_session_t *s, const UTFCHAR *utf16, unsigned int *num_chars)
 Converts a string from UTF-16BE to UTF-8.

Function Documentation

UTF8CHAR* utf16be_to_utf8 ( iml_session_t *  s,
const UTFCHAR *  utf16,
unsigned int *  num_chars 
)

Converts a string from UTF-16BE to UTF-8.

Parameters:
s current IMLSession for allocating memory for the new string. If NULL, the new string will be allocated using malloc().
utf16 a pointer to a UTF-16BE string.
num_chars location to store the number of UTF-8 characters written, or NULL
Returns:
a pointer to the newly allocated UTF-8 string. If an error occurs, NULL will be returned.

UTF8CHAR* utf32_to_utf8 ( iml_session_t *  s,
const UTF32CHAR utf32,
unsigned int *  num_chars 
)

Converts a string from UTF-32 to UTF-8.

Parameters:
s current IMLSession for allocating memory for the new string. If NULL, the new string will be allocated using malloc().
utf32 a pointer to a UTF-32 string.
num_chars location to store the number of UTF-8 characters written, or NULL
Returns:
a pointer to the newly allocated UTF-8 string. If an error occurs, NULL will be returned.

const UTF8CHAR* utf8_next_char ( const UTF8CHAR in  ) 

Finds the next UTF-8 character in the string after in.

No check is made to see if the character found is actually valid.

Parameters:
in a pointer to a position within a UTF-8 string
Returns:
a pointer to the found character, or NULL if in points to an invalid UTF-8 string.

UTFCHAR* utf8_to_utf16be ( iml_session_t *  s,
const UTF8CHAR utf8,
unsigned int *  num_chars 
)

Converts a string from UTF-8 to UTF-16BE.

Parameters:
[in] s current IMLSession for allocating memory for the new string. If NULL, the new string will be allocated using malloc().
[in] utf8 a pointer to a UTF-8 string.
[out] num_chars location to store the number of UTF-16 characters written, or NULL
Returns:
a pointer to the newly allocated UTF-16 string. If an error occurs, NULL will be returned.

UTF32CHAR* utf8_to_utf32 ( iml_session_t *  s,
const UTF8CHAR utf8,
unsigned int *  num_chars 
)

Converts a string from UTF-8 to UTF-32.

Parameters:
s current IMLSession for allocating memory for the new string. If NULL, the new string will be allocated using malloc().
utf8 a pointer to a UTF-8 string.
num_chars location to store the number of UTF-32 characters written, or NULL
Returns:
a pointer to the newly allocated UTF-32 string. If an error occurs, NULL will be returned.


Generated on Fri Sep 7 15:51:41 2007 for unihan-core-le by  doxygen 1.5.2