我有一张桌子,在joomla中我得到以下数据:
1. fc k��ln - vfl wolfsburg
germany 1. bundesliga
所以我创建了一个测试页面,我将标题设置为utf-8,一切都很好,我收到了想要的数据:
Array
(
[0] => Array
(
[id] => 4e36e64eb34d2
[team1] => 1. FC Köln
[team2] => VFL Wolfsburg
[league] => Germany 1. Bundesliga
[sport] => Soccer
[time] => 2011-08-06 15:30:00
)
)
我还检查了joomla标题,它包含charset:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
我做错了什么?在获取数据之前,我还需要一些额外的命令吗?
答案 0 :(得分:1)
免责声明:我不使用Joomla
这实际上是一个Joomla问题not a MySQL Problem。你有没有机会使用Joomla 1.0?
以下是Joomla文档中如何activate the MySQL Query SET NAMES using utf8显示的内容。
您可能还需要在数据库连接中使用排序规则设置
以下是在Windows 7中运行的MySQL 5.5.12的默认设置
mysql> show variables like 'collation%';
+----------------------+-------------------+
| Variable_name | Value |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
+----------------------+-------------------+
3 rows in set (0.00 sec)
mysql> show variables like 'char%';
+--------------------------+---------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | C:\MySQL_5.5.12\share\charsets\ |
+--------------------------+---------------------------------+
尝试在会话中设置字符集和校对变量,或在my.cnf中设置并重新启动mysql