This script converts accented characters (high-ordered ascii) to the
corresponding HTML escape code. Useful for putting non-english text on a
webpage. Populate @ascii_codes with the appropriate code for the characters
you wish to convert.
#!/usr/bin/perl
@ascii_codes = (153,154,169,171,187..214,224..254);
@funny_chars = split("", pack("C*", @ascii_codes));
@input = <>;
foreach $line (@input) {
for ($x=0; $x<=$#ascii_codes; $x++) {
$line =~ s/$funny_chars[$x]/&#$ascii_codes[$x]/g;
}
print $line;
}