I wrote a small program to go through /usr/share/dict/words finding palindromes
while(<>){
chomp;
print "$_\n" if $_ eq reverse;
}
However, this does not work for a list of Danish words encoded in Latin-1 (ISO-8859-1).
Just wondering how I’d go about making it work?
Use locale? And maybe also turn on the Unicode flag on STDIN:
Without the
binmodeit could have been a nice one-liner: