I'm using magento 1.7.0 in Spanish language. When export the CSV file form sales order.The Spanish character are changed. I have found the reason for that. During the export to csv the charset is set to western europe. So now i need to change that to UTF-8.
How to change that.
Open the file you just saved and you'll see "UTF-16 Unicode Text" as the selected option in the "File -> Save As..." dialog. If you "File -> Save" then the contents of the ". csv" file are what you'd get if you saved it as "UTF-16 Unicode Text".
Exporting to CSV uses a default encoding of Unicode (UTF-16le).
Check default charset on your server (PHP, apache/nginx). If there everything looks ok, add <charset>utf8</charset>
to database section in app/etc/local.xml
, then default_section should looks like:
<default_setup>
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[root]]></username>
<password><![CDATA[]]></password>
<dbname><![CDATA[magento]]></dbname>
<initStatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<pdoType><![CDATA[]]></pdoType>
<active>1</active>
<charset>utf8</charset>
</connection>
</default_setup>
Hope it helps! Long time ago this charset tag solved some nasty encoding problems in my Magento installation :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With