perl-unicode

Encoding to entity

2003-04-25 01:30:08
Hi,

I need to convert Encoding to entity using Perl. (xml
file)

I have following Unicode and entity names (937 entity,
text file format).
\x{0177}   ŷ
\x{0176}   Ŷ
\x{00bd}   ½
...

The following code is very difficult to write for all
the entities.

$temp_pack = pack("U", 0x2019);

$lines=~s/$temp_pack/\&rsquor\;/g;

How to pack using strings/another method, please
advice.

Regards,
JD

<Prev in Thread] Current Thread [Next in Thread>