phpMyAdmin 中的编码问题。特别是包含俄语文本的记录

发布于 2024-09-06 00:24:19 字数 635 浏览 1 评论 0原文

我正在为我未来的 CMS/框架制作小模块/插件。我从一开始就希望它具有多语言支持。

  • 我将我的新数据库设置为 utf8_unicode_ci (我读到它更准确,然后 utf8_general_ci
  • 将我的文件设置为 UTF-8 without BOM
  • 每个页面都有头部 内容类型:text/html; charset=utf8

当我注册新用户时,新记录将添加到用户表中。我尝试使用俄罗斯昵称注册用户。当我将它插入成型时,一切都很好。将记录添加到表中。登录并用俄语打招呼也很好。但当我查看表中的记录时,昵称是一些乱码。我在浏览器中尝试了所有编码。没有任何帮助。


UPD:我什至尝试使用 SQLyog 查看数据。显示与 phpMyAdmin 相同。

我的意思的小屏幕截图 alt text http://s43.radikal.ru/ i101/1006/a9/f458f64a9918.png


谁能给我解释一下,可能是什么问题?

I'm making small module/plugin for my future CMS/Framework. I wanted it from begining to be with multi-language support.

  • I set my new database to utf8_unicode_ci (I read that it is more accurate, then utf8_general_ci)
  • Set my files to UTF-8 without BOM
  • Every page has in head Content-Type: text/html; charset=utf8

When I register new user new record is added to user table. I tried to register user with russian nickname. When I inserted it to form it was fine. Added record to table. Signed in and showed greetings fine in russian too. But when I looked at the record in table the nickname was some gibberish characters. I tried all encodings in browser. Nothing helped.


UPD: I even tried to view data with SQLyog. Shows same as phpMyAdmin.

Small screenshot of what I mean alt text http://s43.radikal.ru/i101/1006/a9/f458f64a9918.png


Could anyone explain to me, what might be the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吝吻 2024-09-13 00:24:19

这是我之前关于同一问题的回答,请尝试: 如何在php中正确显示另一种语言的mysql表数据

Here's an earlier answer of mine about the same problem, try that: How to display a mysql table data in another language properly in php

攒眉千度 2024-09-13 00:24:19

每个页面的头部都有 Content-Type: text/html;字符集=utf8

是元标记还是 HTTP 标头?一定是后一种。

每次在 PHP 脚本中连接到数据库时,都必须运行 SET NAMES utf8 查询

Every page has in head Content-Type: text/html; charset=utf8

is it meta tag or HTTP header? must be a latter one.

and you have to run SET NAMES utf8 query every time you connect to the database in your PHP scripts

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文