>At 14:26 11/04/96 -0400, "Stephane Jose" <jose.stephane@uqam.ca> wrote: >Perl does *not* have any troubles parsing accented characters. >"é". So you need a translation table, and a lot of lines like this: > > s/=E9/é/g; I've written this table for use in my interactive quiz program for foreign language instruction. Here's my routine for handling accents. The last six or so substitutions are "dead key accents" They translate, for example, u" into a u with a diaresis over it; this is useful if you expect users with browsers that don't handle iso-8859-1 input. sub Accents { local($value) = @_; study($value); $value =~ s/\300/À/g; $value =~ s/\304/Ä/g; $value =~ s/\307/Ç/g; $value =~ s/\311/É/g; $value =~ s/\321/Ñ/g; $value =~ s/\326/Ö/g; $value =~ s/\334/Ü/g; $value =~ s/\337/ß/g; $value =~ s/\340/à/g; $value =~ s/\341/á/g; $value =~ s/\342/â/g; $value =~ s/\344/ä/g; $value =~ s/\347/ç/g; $value =~ s/\350/è/g; $value =~ s/\351/é/g; $value =~ s/\352/ê/g; $value =~ s/\354/ì/g; $value =~ s/\355/í/g; $value =~ s/\356/î/g; $value =~ s/\357/ï/g; $value =~ s/\361/ñ/g; $value =~ s/\362/ò/g; $value =~ s/\363/ó/g; $value =~ s/\364/ô/g; $value =~ s/\366/ö/g; $value =~ s/\371/ù/g; $value =~ s/\372/ú/g; $value =~ s/\374/ü/g; $value =~ s/([AEIOUaeio])'/&$1acute;/g; $value =~ s/\^([AEIOUaeiou])/&$1circ;/g; $value =~ s/`([AEIOUaeiou])/&$1grave;/g; $value =~ s/~([ANOano])/&$1tilde;/g; $value =~ s/:([AEIOUYaeiouy])/&$1uml;/g; $value =~ s/,([Cc])/&$1cedil;/g; $value =~ s/sss/ß/g; return($value); }