Functions for checking that strings contain UTF-8 characters only. More...

Go to the source code of this file.
Macros | |
| #define | ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) |
Functions | |
| static const char * | UTF8_char_validate (int len, const char *data) |
| int | UTF8_validate (int len, const char *data) |
| int | UTF8_validateString (const char *string) |
Variables | |
| struct { | |
| struct { | |
| char lower | |
| char upper | |
| } bytes [4] | |
| int len | |
| } | valid_ranges [] |
Functions for checking that strings contain UTF-8 characters only.
See page 104 of the Unicode Standard 5.0 for the list of well formed UTF-8 byte sequences.
Definition in file utf-8.c.
| #define ARRAY_SIZE | ( | a | ) | (sizeof(a) / sizeof(a[0])) |
|
static |
| int UTF8_validate | ( | int | len, |
| const char * | data | ||
| ) |
| int UTF8_validateString | ( | const char * | string | ) |
| struct { ... } bytes[4] |
up to 4 bytes can be used per character
| struct { ... } valid_ranges[] |
Structure to hold the valid ranges of UTF-8 characters, for each byte up to 4