Larry Wall schreef: > Dr.Ruud: >> Comparing strings in Perl5, using NFKD: >> >> perl5 -MUnicode::Normalize -we ' >> ($\, $,) = ("\n", "\t") ; >> $x = qq{Henry IV} ; >> $y = qq{Henry \x{2163}} ; >> print qq{<$x>}, qq{<$y>}, length $x, length $y, $x eq $y ? 1 : 0 ; >> # $x = NFKD $x ; >> $y = NFKD $y ; >> print qq{<$x>}, qq{<$y>}, length $x, length $y, $x eq $y ? 1 : 0 ; >> ' >> Wide character in print at -e line 5. >> <Henry IV> <Henry ?.?> 8 7 0 >> <Henry IV> <Henry IV> 8 8 1 >> >> >> How will the Str type do this? > > That'd just be: > > eqv($x, $y, :(NFKD $^s)) > > [...]
Thanks. Is it also possible to define an NKFD_Str type so that you can code C<$x === $y>, and the NKFD-stuff is done because of the type's .SKID? (Can a "type" have a (type-wide) .SKID?) -- Affijn, Ruud "Gewoon is een tijger."