Do you know where your variables are? | |
PerlMonks |
Re: dealing with encoding while converting data from MySQL to Postgresby Anonymous Monk |
on Dec 10, 2011 at 11:52 UTC ( [id://942792]=note: print w/replies, xml ) | Need Help?? |
This is a tough situation, and personally I would go through every row, every text column in the original database, then inspect it with e.g. Encode::is_utf8(), and if it happens to not be valid utf8, try to decode it with Encode::decode("cp1252", $str) ("cp1252" seems to be a good bet for many western languages), and only then insert it to the postgres database. This will probably leave you with some corrupted entries which you can then later figure out how to detect and fix.
In Section
Seekers of Perl Wisdom
|
|