good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
utf file to ansi, but doesn't work?by ultranerds (Hermit) |
on Feb 28, 2011 at 10:15 UTC ( [id://890539]=perlquestion: print w/replies, xml ) | Need Help?? |
ultranerds has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I've got a UTF8 file (set in "UTF-8 without BOM" in Notepad++), and I'm trying to convert it automatically to ANSI, so I can read it and place in my latin1 mySQL table Thus far I have: This "seems" to work... but for some reason when I open this new file in NotePad++, it doesn't seem to recognise the encoding type (it also comes up weird in the DB, i.e "Vols + transferts + hébergement en formule "tout ...") Am I invoking `iconv` incorrecty, or maybe something else? Been driving me nuts for hours trying to fix this :( BTW: doing a conversion with a perl module isn't really idea, due to the fact this file is 30+mb in size, and an XML file (so its not very effecient to keep using utf8($string)->latin; for every value in that XML file) TIA! Andy
Back to
Seekers of Perl Wisdom
|
|