I'm no expert on Unicode, but I think this is precisely the problem that Unicode::Normalize sets out to solve.
When you say you "want to cover both equivalence(s)", do you mean you want all such equivalences to compare equal? If so, based on a quick read of the slightly opaque documentation, I would guess you want to convert each string into either NFC or NFKC form: it isn't clear to me what the difference between the two is, but they both return a string formed by "compatibility decomposition followed by canonical composition".
If you're not certain, I'd suggest devising some tests that characterise the equivalences you're trying to allow, and run them through something like:
sub ucompare { my($s, $t) = @_; use Unicode::Normalize; print "NFC-equivalent" if NFC($s) eq NFC($t); print "NFKC-equivalent" if NFKC($s) eq NFKC($t); }
Hope this helps,
Hugo
In reply to Re: Help needed to compare two unicode strings!!!
by hv
in thread Help needed to compare two unicode strings!!!
by pijush
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |