<div dir="ltr"><div>Hi,</div><div><br></div><div>I'm implementing a caseless matching for strings used as identifiers. I'm aware that NFKC_Casefold mapping and related toNFKC_Casefold() string transform are designed for such scenario. Unfortunately, the language and libraries I'm using do not implement toNFKC_Casefold(), so I'm looking for an alternative approach.</div><div><br></div><div>My use case does not seem to require the removal of default-ignorables, for now I'm only concerned with the case and compatibility variations. It looks like the definition of the compatibility caseless match is what I need:</div><div><br></div><div>A string X is a compatibility caseless match for a string Y if and only if: NFKD(toCasefold(NFKD(toCasefold(NFD(X))))) =
NFKD(toCasefold(NFKD(toCasefold(NFD(Y))))</div><div><br></div><div>However, I can't seem to find the case where that extra cycle of folding/normalization makes the difference. It seems to me that the same result - compatibility caseless match - can be achieved with a simpler approach:</div><div><br></div><div>NFC(toCasefold(NFKD(X))) <br></div><div><br></div><div>Basically, I think about it as 1) removing the compatibility variations by normalizing with decomposition, 2) then removing the case differences from this decomposed sequence, 3) and finally storing a folded string in a potentially shorter NFC form.</div><div><br></div><div>It looks like it checks all the boxes, and my - likely naive - testing shows that</div><div><br></div><div>NFC(toCasefold(NFKD(X))) = NFKD(toCasefold(NFKD(toCasefold(NFD(X)))))<br></div><div><br></div><div>I'm sure I'm missing something, and would appreciate an explanation why/when this won't work.<br></div><div><br>Yuri</div></div>