http://www.perlmonks.org?node_id=675248

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:
open (FILE, ">:encoding(iso-8859-1)", "$file");
It works fine except that some characters such as quotes, double quotes, dashes, astrophes are coded as, for example:
becomes \x{201c} becomes \x{2013}
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