Jaap has asked for the wisdom of the Perl Monks concerning the following question:
But a character like the euro sign (0x20ac) is not converted with this.my $string = "Weird char: " . chr(0x2a) . ".\n"; $string =~ s/([\x00-\x1f])/sprintf('&#x%02X;', ord($1))/ge;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Encode text to XML €
by joe++ (Friar) on Sep 27, 2002 at 15:20 UTC | |
by Jaap (Curate) on Sep 27, 2002 at 15:34 UTC | |
|
Re: Encode text to XML €
by diotalevi (Canon) on Sep 27, 2002 at 16:54 UTC | |
|
Re: Encode text to XML €
by hiseldl (Priest) on Sep 27, 2002 at 15:22 UTC | |
|
Re: Encode text to XML €
by Jaap (Curate) on Sep 27, 2002 at 16:02 UTC | |
by Jaap (Curate) on Sep 27, 2002 at 16:06 UTC |