in reply to Re: Re: Perl Monks in other languages?
in thread Perl Monks in other languages?

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;


Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).