Mysql-Html字符串问题
我有一张表,在 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 标头,它包含字符集:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
我做错了什么?
I have a table, in joomla I'm getting the following data:
1. fc k��ln - vfl wolfsburg
germany 1. bundesliga
so I created a test page, I set up the header as utf-8, and everything was fine, I received the wanted data:
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
)
)
I also check the joomla header and it's contains the charset:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的数据库连接必须设置为UTF8
当然你表中的数据必须是utf-8,检查这一点。
其他可能要检查的事情是您的浏览器是否将此页面视为 utf8(在 firefox 中:查看 -> 字符编码)
your database connection has to be set UTF8
Ofcourse your data in table has to be utf-8, check this.
Other possibible thing to check is if your browser sees this page as utf8 (in firefox: View->character encoding)
也许您的文件编码错误?当我的文件采用 CP-1251 格式时,我遇到了类似的问题,所有数据均采用 UTF-8 格式,并且我需要显示丹麦符号。更改文件编码已经解决了这个问题。尝试一下,也许对你也有帮助。
Maybe your files are in wrong encoding? I was having similar problem whan my files were in CP-1251, all data were in UTF-8 and I needed to show danish symbols. Changing file-encoding has solved this problem. Try, maybe it will be helpfull for you too.