CYAML Internals
|
CYAML functions for handling utf8 text. More...
Functions | |
static unsigned | cyaml_utf8_char_len (uint8_t b) |
unsigned | cyaml_utf8_get_codepoint (const uint8_t *s, unsigned *len) |
static unsigned | cyaml_utf8_to_lower (unsigned c) |
static int | cyaml_utf8_difference (unsigned a, unsigned b) |
int | cyaml_utf8_casecmp (const void *const str1, const void *const str2) |
CYAML functions for handling utf8 text.
int cyaml_utf8_casecmp | ( | const void *const | str1, |
const void *const | str2 | ||
) |
Case insensitive comparason.
[in] | str1 | First string to be compared. |
[in] | str2 | Second string to be compared. |
|
inlinestatic |
Get expected byte-length of UTF8 character.
Finds the number of bytes expected for the UTF8 sequence starting with the given byte.
[in] | b | First byte of UTF8 sequence. |
|
inlinestatic |
Find the difference between two codepoints.
a | First codepoint. |
b | Second codepoint. |
unsigned cyaml_utf8_get_codepoint | ( | const uint8_t * | s, |
unsigned * | len | ||
) |
Get a codepoint from the input string.
Caller must provide the expected length given the first input byte.
If a multi-byte character contains an invalid continuation byte, the character length will be updated on exit to the number of bytes consumed, and the replacement character, U+FFFD will be returned.
[in] | s | String to read first codepoint from. |
[in,out] | len | Expected length of first character, updated on exit. |
0xfffd
if character is invalid.
|
static |
Convert a Unicode codepoint to lower case.
[in] | c | Codepoint to convert to lower-case, if applicable. |