Skip to content

check composition exclusions in is_already_nfc - #89

Open
Arawoof06 wants to merge 1 commit into
ada-url:mainfrom
Arawoof06:nfc-composition-exclusions
Open

check composition exclusions in is_already_nfc#89
Arawoof06 wants to merge 1 commit into
ada-url:mainfrom
Arawoof06:nfc-composition-exclusions

Conversation

@Arawoof06

Copy link
Copy Markdown
Contributor

is_already_nfc in src/normalization.cpp treats any character with a canonical decomposition longer than one code point as already NFC, which skips composition exclusions and non-starter decompositions whose NFC form is decomposed: U+0958 normalizes to U+0915 U+093C, U+1F71 to U+03AC, and U+0344 to U+0308 U+0301. For those the quick check returns true, so a direct normalize() leaves the string unnormalized and is_already_nfc misreports its result. The fix recomposes each character's canonical decomposition and keeps the fast path only when it collapses back to the original code point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant