#!/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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Convert accented chars to html escape codes
by merlyn (Sage) on Jul 28, 2001 at 10:02 UTC | |
by tune (Curate) on Nov 09, 2001 at 23:49 UTC |