-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UTF8String::normalize() #4715
Conversation
# define UINT16_MAX 65535U | ||
#endif | ||
|
||
#include "utf8proc_data.c" |
Check notice
Code scanning / CodeQL
Include header files only Note
(lbc == UTF8PROC_BOUNDCLASS_START) ? true : // GB1 | ||
(lbc == UTF8PROC_BOUNDCLASS_CR && // GB3 | ||
tbc == UTF8PROC_BOUNDCLASS_LF) ? false : // --- | ||
(lbc >= UTF8PROC_BOUNDCLASS_CR && lbc <= UTF8PROC_BOUNDCLASS_CONTROL) ? true : // GB4 | ||
(tbc >= UTF8PROC_BOUNDCLASS_CR && tbc <= UTF8PROC_BOUNDCLASS_CONTROL) ? true : // GB5 | ||
(lbc == UTF8PROC_BOUNDCLASS_L && // GB6 | ||
(tbc == UTF8PROC_BOUNDCLASS_L || // --- | ||
tbc == UTF8PROC_BOUNDCLASS_V || // --- | ||
tbc == UTF8PROC_BOUNDCLASS_LV || // --- | ||
tbc == UTF8PROC_BOUNDCLASS_LVT)) ? false : // --- | ||
((lbc == UTF8PROC_BOUNDCLASS_LV || // GB7 | ||
lbc == UTF8PROC_BOUNDCLASS_V) && // --- | ||
(tbc == UTF8PROC_BOUNDCLASS_V || // --- | ||
tbc == UTF8PROC_BOUNDCLASS_T)) ? false : // --- | ||
((lbc == UTF8PROC_BOUNDCLASS_LVT || // GB8 | ||
lbc == UTF8PROC_BOUNDCLASS_T) && // --- | ||
tbc == UTF8PROC_BOUNDCLASS_T) ? false : // --- | ||
(tbc == UTF8PROC_BOUNDCLASS_EXTEND || // GB9 | ||
tbc == UTF8PROC_BOUNDCLASS_ZWJ || // --- | ||
tbc == UTF8PROC_BOUNDCLASS_SPACINGMARK || // GB9a | ||
lbc == UTF8PROC_BOUNDCLASS_PREPEND) ? false : // GB9b | ||
(lbc == UTF8PROC_BOUNDCLASS_E_ZWG && // GB11 (requires additional handling below) | ||
tbc == UTF8PROC_BOUNDCLASS_EXTENDED_PICTOGRAPHIC) ? false : // ---- | ||
(lbc == UTF8PROC_BOUNDCLASS_REGIONAL_INDICATOR && // GB12/13 (requires additional handling below) | ||
tbc == UTF8PROC_BOUNDCLASS_REGIONAL_INDICATOR) ? false : // ---- | ||
true; // GB999 |
Check notice
Code scanning / CodeQL
Complex condition Note
utf8proc_int32_t uc; | ||
for (rpos = 0; rpos < length; rpos++) { | ||
uc = buffer[rpos]; | ||
if (uc == 0x000D && rpos < length-1 && buffer[rpos+1] == 0x000A) rpos++; |
Check notice
Code scanning / CodeQL
For loop variable changed in body Note
Implements #4710, supports internal
utf8proc
or external library if building withPOCO_UNBUNDLED
.