Tizen Native API
Unicode String

Functions

size_t eina_unicode_strlen (const Eina_Unicode *ustr)
 Returns the length of a Eina_Unicode string.
size_t eina_unicode_strnlen (const Eina_Unicode *ustr, int n)
 Returns the length of a Eina_Unicode string, up to a limit.
Eina_Unicodeeina_unicode_strdup (const Eina_Unicode *text)
 Same as the standard strdup just with Eina_Unicode instead of char.
Eina_Unicodeeina_unicode_strndup (const Eina_Unicode *text, size_t n)
 Same as strdup but cuts on the given size. Assumes n < len.
int eina_unicode_strcmp (const Eina_Unicode *a, const Eina_Unicode *b) 2)
 Same as the standard strcmp just with Eina_Unicode instead of char.
Eina_Unicodeeina_unicode_strcpy (Eina_Unicode *dest, const Eina_Unicode *source) 2)
 Same as the standard strcpy just with Eina_Unicode instead of char.
Eina_Unicodeeina_unicode_strstr (const Eina_Unicode *haystack, const Eina_Unicode *needle) 2)
 Same as the standard strstr just with Eina_Unicode instead of char.
Eina_Unicodeeina_unicode_strncpy (Eina_Unicode *dest, const Eina_Unicode *source, size_t n) 2)
 Same as the standard strncpy just with Eina_Unicode instead of char.
Eina_Unicodeeina_unicode_escape (const Eina_Unicode *str)
static Eina_Unicode eina_unicode_utf8_next_get (const char *buf, int *iindex) 2)
 Reads UTF8 bytes from buf, starting at iindex and returns the decoded code point at iindex offset, and advances iindex to the next code point after this. iindex is always advanced, unless if the advancement is after the NULL. On error: return a codepoint between DC80 to DCFF where the low 8 bits are the byte's value.
Eina_Unicode eina_unicode_utf8_get_next (const char *buf, int *iindex) 2)
 Reads UTF8 bytes from buf, starting at iindex and returns the decoded code point at iindex offset, and advances iindex to the next code point after this. iindex is always advanced, unless if the advancement is after the NULL. On error: return a codepoint between DC80 to DCFF where the low 8 bits are the byte's value.
Eina_Unicode eina_unicode_utf8_get_prev (const char *buf, int *iindex) 2)
 Reads UTF8 bytes from buf, starting at iindex and returns the decoded code point at iindex offset, and moves àp iindex to the previous code point. iindex is always moved, as long as it's not past the start of the string. On error: return a codepoint between DC80 to DCFF where the low 8 bits are the byte's value.
int eina_unicode_utf8_get_len (const char *buf)
 Returns the number of unicode characters in the string. That is, the number of Eina_Unicodes it'll take to store this string in an Eina_Unicode string.
Eina_Unicodeeina_unicode_utf8_to_unicode (const char *utf, int *_len)
 Converts a utf-8 string to a newly allocated Eina_Unicode string.
char * eina_unicode_unicode_to_utf8 (const Eina_Unicode *uni, int *_len)
 Converts an Eina_Unicode string to a newly allocated utf-8 string.

Typedefs

typedef uint32_t Eina_Unicode

These functions provide basic unicode string handling.

Eina_Unicode is a type that holds unicode codepoints.


Typedef Documentation

A type that holds Unicode codepoints.


Function Documentation

See also:
eina_str_escape()
Since :
2.3
Parameters:
[in]strThe string to escape.
Returns:
The escaped string.
int eina_unicode_strcmp ( const Eina_Unicode a,
const Eina_Unicode b 
)

Same as the standard strcmp just with Eina_Unicode instead of char.

Parameters:
[in]aA string to be compared
[in]bA string to be compared
Returns:
an integer less than, equal to, or greater than zero if a is found, respectively, to be less than, to match, or be greater than b.
Since :
2.3
Eina_Unicode* eina_unicode_strcpy ( Eina_Unicode dest,
const Eina_Unicode source 
)

Same as the standard strcpy just with Eina_Unicode instead of char.

Parameters:
[in]destThe destination string
[in]sourceThe source string
Returns:
The copied string pointer
Since :
2.3

Same as the standard strdup just with Eina_Unicode instead of char.

Parameters:
[in]textThe string to be duplicated
Returns:
A new string
Since :
2.3
size_t eina_unicode_strlen ( const Eina_Unicode ustr)

Returns the length of a Eina_Unicode string.

This function returns the number of characters in a string.

Since :
2.3
Remarks:
If the terminating character is not found in the string, it can go infinite loop
Parameters:
[in]ustrThe string to search
Returns:
The number of characters
Eina_Unicode* eina_unicode_strncpy ( Eina_Unicode dest,
const Eina_Unicode source,
size_t  n 
)

Same as the standard strncpy just with Eina_Unicode instead of char.

Parameters:
[in]destThe destination string
[in]sourceThe source string
[in]nBytes to be copied
Returns:
The copied string pointer
Since :
2.3
Eina_Unicode* eina_unicode_strndup ( const Eina_Unicode text,
size_t  n 
)

Same as strdup but cuts on the given size. Assumes n < len.

Since :
2.3
Parameters:
[in]textThe text to duplicate.
[in]nThe maximum size of the text to duplicate.
Returns:
The duplicated string.
Remarks:
This function duplicates text. The resuting string is cut on n. n is assumed to be lesser (<) than the length of text. When not needed anymore, the returned string must be freed.
Since (EFL) :
1.1.0
size_t eina_unicode_strnlen ( const Eina_Unicode ustr,
int  n 
)

Returns the length of a Eina_Unicode string, up to a limit.

Since :
2.3
Remarks:
This function returns the number of characters in string, up to a maximum of n. If the terminating character is not found in the string, it returns n.
Parameters:
[in]ustrString to search
[in]nMax length to search
Returns:
Number of characters or n.
Eina_Unicode* eina_unicode_strstr ( const Eina_Unicode haystack,
const Eina_Unicode needle 
)

Same as the standard strstr just with Eina_Unicode instead of char.

Parameters:
[in]haystackThe string
[in]needleThe substring to be found
Returns:
haystack is returned
Since :
2.3
char* eina_unicode_unicode_to_utf8 ( const Eina_Unicode uni,
int *  _len 
)

Converts an Eina_Unicode string to a newly allocated utf-8 string.

Since :
2.3
Parameters:
[in]unithe Eina_Unicode string
[out]_lenthe length byte length of the return utf8 string.
Returns:
the newly allocated utf-8 string.
Since (EFL) :
1.1.0
int eina_unicode_utf8_get_len ( const char *  buf)

Returns the number of unicode characters in the string. That is, the number of Eina_Unicodes it'll take to store this string in an Eina_Unicode string.

Since :
2.3
Parameters:
[in]bufthe string
Returns:
the number of unicode characters (not bytes) in the string
Since (EFL) :
1.1.0
Eina_Unicode eina_unicode_utf8_get_next ( const char *  buf,
int *  iindex 
)

Reads UTF8 bytes from buf, starting at iindex and returns the decoded code point at iindex offset, and advances iindex to the next code point after this. iindex is always advanced, unless if the advancement is after the NULL. On error: return a codepoint between DC80 to DCFF where the low 8 bits are the byte's value.

Since :
2.3
Parameters:
[in]bufthe string
[out]iindexthe index to look at and return by.
Returns:
the codepoint found, 0 if buf or iindex are NULL
Since (EFL) :
1.1.0
Deprecated:
use eina_unicode_utf8_next_get Deprecated since Tizen 2.4
Eina_Unicode eina_unicode_utf8_get_prev ( const char *  buf,
int *  iindex 
)

Reads UTF8 bytes from buf, starting at iindex and returns the decoded code point at iindex offset, and moves àp iindex to the previous code point. iindex is always moved, as long as it's not past the start of the string. On error: return a codepoint between DC80 to DCFF where the low 8 bits are the byte's value.

Since :
2.3
Parameters:
[in]bufthe string
[out]iindexthe index to look at and return by.
Returns:
the codepoint found.
Since (EFL) :
1.1.0
static Eina_Unicode eina_unicode_utf8_next_get ( const char *  buf,
int *  iindex 
) [static]

Reads UTF8 bytes from buf, starting at iindex and returns the decoded code point at iindex offset, and advances iindex to the next code point after this. iindex is always advanced, unless if the advancement is after the NULL. On error: return a codepoint between DC80 to DCFF where the low 8 bits are the byte's value.

Since :
2.4
Parameters:
[in]bufthe string
[out]iindexthe index to look at and return by.
Returns:
the codepoint found, 0 if buf or iindex are NULL
Since (EFL) :
1.8.0
Eina_Unicode* eina_unicode_utf8_to_unicode ( const char *  utf,
int *  _len 
)

Converts a utf-8 string to a newly allocated Eina_Unicode string.

Since :
2.3
Parameters:
[in]utfthe string in utf-8
[out]_lenthe length of the returned Eina_Unicode string.
Returns:
the newly allocated Eina_Unicode string.
Since (EFL) :
1.1.0

Variable Documentation

Same as the standard strlen just with Eina_Unicode instead of char.

Since :
2.3