in reply to Foreign language characters...
my @names = qw/Árni Óli Þorgeir Ýr Ægir Þór /; my @names = fix_chars(@names); print "$_\n", for @names; sub fix_chars { for (@_) { tr/ÁÐÉÍÓÚÝÖáðéíóúýö/ADEIOUYOadeiouyo/; s/Þ/Th/; s/Æ/Ae/; s/þ/th/; s/æ/ae/; s/\W/_/g; # Throw away any remaining non-word chars push @ok,$_; } return @ok; }
This is intended for translating Icelandic into international.
It uses transliteration to substitute single characters and substitution to fix the double letters.
You can of course decide for yourself what characters you will allow and disallow.
--
Regards,
Helgi Briem
helgi AT decode DOT is
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re2: Foreign language characters...
by blakem (Monsignor) on Oct 09, 2002 at 04:27 UTC |