uncommon13 has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I have used the Perl module Encode to convert data from a database containing UTF-8 data to Latin1 when outputting to a file.
Basically, the code is:
It works fine except that some characters such as quotes, double quotes, dashes, astrophes are coded as, for example:open (FILE, ">:encoding(iso-8859-1)", "$file");
The final latin1 output file is an XML file. Is there anyway to convert these to the proper characters under latin1? Would numeric character entities be used since it would be XML file? Is the reason for their insertion since they are non-matching latin1 characters from the UTF-8 conversion? Is there a module or subroutine that could convert these for me? Thanks“ becomes \x{201c} – becomes \x{2013}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: UTF-8 to Latin1 - unmatched characters?
by Joost (Canon) on Mar 20, 2008 at 16:44 UTC | |
Re: UTF-8 to Latin1 - unmatched characters?
by samtregar (Abbot) on Mar 20, 2008 at 16:48 UTC | |
by uncommon13 (Novice) on Mar 27, 2008 at 15:08 UTC | |
by ikegami (Patriarch) on Mar 27, 2008 at 17:41 UTC | |
by uncommon13 (Novice) on Mar 28, 2008 at 14:56 UTC | |
Re: UTF-8 to Latin1 - unmatched characters?
by Juerd (Abbot) on Mar 20, 2008 at 16:46 UTC | |
Re: UTF-8 to Latin1 - unmatched characters?
by Anonymous Monk on Mar 21, 2008 at 14:00 UTC |
Back to
Seekers of Perl Wisdom