UTF8 wrapper functions.
More...
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
◆ utf8_wrap_casecmp()
| int utf8_wrap_casecmp |
( |
const char * | str1, |
|
|
size_t | str1_len, |
|
|
const char * | str2, |
|
|
size_t | str2_len ) |
Compares two strings case insensitive. Set's errno to EINVAL if one string is invalid utf8.
- Parameters
-
| str1 | String1 |
| str1_len | String1 length |
| str2 | String2 |
| str2_len | String2 length |
- Returns
- Same as strcasecmp
◆ utf8_wrap_casefold()
| char * utf8_wrap_casefold |
( |
const char * | str, |
|
|
size_t | len, |
|
|
size_t * | newlen ) |
Casefolds a string
- Parameters
-
| str | String to normalize |
| len | String length |
| newlen | Pointer to size_t for the new string length |
- Returns
- Newly allocated char, caller must free it.
◆ utf8_wrap_normalize()
| char * utf8_wrap_normalize |
( |
const char * | str, |
|
|
size_t | len, |
|
|
size_t * | newlen ) |
Normalizes a string
- Parameters
-
| str | String to normalize |
| len | String length |
| newlen | Pointer to size_t for the new string length |
- Returns
- Newly allocated char, caller must free it.
◆ utf8_wrap_validate()
| bool utf8_wrap_validate |
( |
const char * | str, |
|
|
size_t | str_len ) |
Checks if string is valid utf8
- Parameters
-
| str | String to validate |
| str_len | String length |
- Returns
- true if string is valid, else false