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;
In reply to Encode text to XML € by Jaap
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |