PhpMyAdmin-Gui 中的 UTF-8 显示问题
我的 PMA-GUI 遇到以下问题:
虽然 PHP 脚本提交到我的数据库的数据显示正确,但只有 PMA 将几个德语变音符号(例如 äüß、..)显示为 ⁄ 或 ¤
出现问题也在将表导出到文件时..
MySQL: 5.0.51a-3ubuntu5.8
PMA:3.4.5
数据库与字段是 utf8_general_ci
有人知道解决方案吗?
I've got the following problem with my PMA-GUI:
While the data submitted by PHP-Scripts to my database is displayed correctly, ONLY PMA displays several german Umlaut's (such as äüß, ..) as ü or ä
The problem occurs also while exporting tables to file..
MySQL: 5.0.51a-3ubuntu5.8
PMA: 3.4.5
Database & fields are utf8_general_ci
Does anybody know a solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您确定您的客户端以 utf-8 格式发送数据吗?
在我看来,这似乎是以下内容的重复:
Mysql/Phpmyadmin 中的德语变音
Are you sure that your client is sending data as utf-8?
this seems to me a duplicate of:
German Umlaute in Mysql/Phpmyadmin
您需要确保使用一致的字符集/字符编码。
例如,要标准化为 UTF-8 内容,您的数据库字段的字符集应设置为 UTF-8 。然后,在 PHP 中(如果您有自己的脚本运行来获取数据库信息),您需要添加到 head 部分:
然后,在 PHP 中,在向浏览器输出任何内容之前,包含 内容类型 PHP 标头:
在运行任何 SQL 来获取内容之前(因此在连接之后,但在执行查询之前) ),使用 mysql_set_charset:
您可以将其视为三个步骤
确保一致性以及字符按预期显示的最简单方法是确保在每个阶段定义正确、一致的字符集。
You need to ensure you use consistent use of character set/character encoding.
For example, to normalise to UTF-8 content, your DB fields' character sets should be set to UTF-8. Then, in your PHP (if you have your own scripts running that fetch DB information) you need to then add to the head section:
Then, in the PHP, before any output to the browser, include the content type PHP header:
Before you run any SQL to fetch content (so after you connect, but before executing your query), use mysql_set_charset:
You can think of it as three steps:
The simplest bet to ensure conformity and that characters display as you anticipate, is to ensure the correct, consistant, character set is defined at each stage.