Forum Moderators: coopster & phranque

Message Too Old, No Replies

Unicode Character Data to Numerical Character Reference in Perl

         

leunga

7:42 am on Oct 7, 2005 (gmt 0)

10+ Year Member



I have a mysql database of which its data are all originally stored in UTF-8 format with PHP code. My question is first how to read the data properly in Perl and second is it possible to convert unicode characters to the numerical character reference using any existing avaliable Perl module?

KevinADC

6:00 am on Oct 8, 2005 (gmt 0)

10+ Year Member



look into the Encode.pm module, it's a core perl module. I have never had to use it so I am not familiar with it but you can read the documentation and see if it is what you are looking for:

[perldoc.perl.org...]

you can always search on cpan for UTF8 modules too:

[search.cpan.org...]

leunga

1:11 pm on Oct 10, 2005 (gmt 0)

10+ Year Member



Hi KevinADC,
Thank you for your suggested links.
I could successfully read the data using Perl code. After which, I converted the data to utf-16 using the Unicode::String. I then unpack the resultant string into individual characters and finally re-pack the characters to NCR. Thank you for your insight.
leunga