Change charset for CSV Export file

谁说我不能喝 提交于 2019-12-12 11:06:17

问题


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.


回答1:


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 :)



来源:https://stackoverflow.com/questions/20215700/change-charset-for-csv-export-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!