You need to entitize all characters not within the latin-1 reptiore. I /belive/ this code will do it, assuming $_ is your text, stored as "proper" utf8, with perl's utf-8 flag set.
my $ord; s/(.)/$ord=ord $1; if ($ord < 128) { $1; } else { "&#$1;"; } /ge;
In reply to Re: Re: Re: Perl Monks in other languages?
by theorbtwo
in thread Perl Monks in other languages?
by monsieur_champs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |