问题描述
我正在使用西班牙语的magento 1.7.0.导出CSV文件形式的销售订单时,西班牙语字符已更改.我已经找到了原因.在导出到csv的过程中,字符集设置为西欧.所以现在我需要将其更改为 UTF-8 .
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.
如何更改它.
推荐答案
检查服务器上的默认字符集(PHP,apache/nginx).如果一切正常,请将<charset>utf8</charset>
添加到app/etc/local.xml
中的数据库部分,则default_section应该如下所示:
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>
希望有帮助!很久以前,这个charset标记解决了我的Magento安装中的一些讨厌的编码问题:)
Hope it helps! Long time ago this charset tag solved some nasty encoding problems in my Magento installation :)
这篇关于更改CSV导出文件的字符集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!