[normalize] Adding NORMALIZE_STRING_COMPOSE for NFC unicode normalization
This commit is contained in:
@@ -19,6 +19,11 @@ char *normalize_string_utf8(char *str, uint64_t options) {
|
||||
utf8proc_options |= UTF8PROC_OPTIONS_NFD;
|
||||
}
|
||||
|
||||
if (options & NORMALIZE_STRING_COMPOSE) {
|
||||
have_utf8proc_options = true;
|
||||
utf8proc_options |= UTF8PROC_OPTIONS_NFC;
|
||||
}
|
||||
|
||||
if (options & NORMALIZE_STRING_STRIP_ACCENTS) {
|
||||
have_utf8proc_options = true;
|
||||
utf8proc_options |= UTF8PROC_OPTIONS_STRIP_ACCENTS;
|
||||
|
||||
@@ -45,6 +45,7 @@ As well as normalizations for individual string tokens:
|
||||
#define NORMALIZE_STRING_LOWERCASE 1 << 4
|
||||
#define NORMALIZE_STRING_TRIM 1 << 5
|
||||
#define NORMALIZE_STRING_REPLACE_HYPHENS 1 << 6
|
||||
#define NORMALIZE_STRING_COMPOSE 1 << 7
|
||||
|
||||
#define NORMALIZE_TOKEN_REPLACE_HYPHENS 1 << 0
|
||||
#define NORMALIZE_TOKEN_DELETE_HYPHENS 1 << 1
|
||||
|
||||
Reference in New Issue
Block a user