in reply to Help needed to compare two unicode strings!!!
I have tried to execute following script to compare two UTF-8 encoded strings.
Please Select Japanese Shift-JIS encoding in browser to see the correct form of the stringuse Unicode::Normalize; my $string1 = 'トウキョウ'; #Full width Katakana my $string2 = 'トウキョウ'; #Half width Katakana print "NFC-equivalent\n" if NFC($string1) eq NFC($string2); print "NFD-equivalent\n" if NFD($string1) eq NFD($string2); print "NFKD-equivalent\n" if NFKD($string1) eq NFKD($string2); print "NFKC-equivalent\n" if NFKC($string1) eq NFKC($string2); print "End\n";
|
|---|