即使我将字符集和排序规则设置为 utf8_unicode_ci,phpmyadmin 也会将日语字符显示为一堆问号

发布于 2024-07-09 19:08:42 字数 596 浏览 4 评论 0原文

好吧,我按照此处找到的所有说明进行操作 我可以在我的页面上显示各种多语言字符...
问题是在 phpmyadmin 中,日文字符被问号替换,就像一堆 ???? ??? 拼凑在一起。 我认为我的数据库排序规则有问题,但我只是想在这里验证一下。

我们之前已经在默认排序规则上设置了此数据库,即 latin_swedish_ci 而且它已经有很多数据了。 现在我们必须添加一些需要支持特殊字符的表,所以我绝对无法将数据库的排序规则设置为 utf8。 我的解决方案是仅在需要此类支持的表以及我们期望包含特殊字符的特定列上使用 utf8
但 phpmyadmin 仍然将它们显示为 ??????

我的另一个问题是这些字段可以搜索吗?
我的意思是,如果该字段包含一些日语字符并且我输入了 sayuri 作为关键字,那么日语字符是否相当于其英语发音的音节?

okee, I followed all instructions I could find here
and i could display all kinds of multilingual characters on my pages...
The problem is in phpmyadmin the japanese characters are replaced by question marks, as in a bunch of ???? ??? pieced together. I think there's a problem with my database's collation but I just wanted to verify that here.

We've had this database set before on a default collation which is latin_swedish_ci
and it already has a lot of data. Now we had to add some tables that require support for special characters, so I definitely just couldn't set the database's collation to utf8. My solution was to use utf8 only on the tables which required such support and the specific columns where we expected special characters to be contained.
But still phpmyadmin displayed them as ????.

Another question that I have is will these fields be searchable?
I mean if the field contains some japanese characters and I typed sayuri as keyword, will the japanese character equivalent to their syllables pronounced in english?

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

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

发布评论

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

评论(3

北陌 2024-07-16 19:08:42

嗯,关于你的第一个问题,你的系统上安装了日语字体吗? 大多数操作系统上都没有默认安装它们,但我不知道您的操作系统是什么。 下一个很愚蠢,但是您的浏览器设置正常吗?

下一个问题,答案是否定的,如果你搜索“吉永小百合”,它不会与吉永小百合匹配。

注意:你能看到我的日语字符吗?

Mmm, as to your first question do you have Japanese fonts installed on your system? They aren't installed by default on most OSs, but I have no idea what your OS is. Next one is silly but are your Browser settings Ok?

Next question, the answer is no, if you search for 吉永 小百合 it wont' match with Yoshinaga Sayuri.

Note: Can you see my Japanese characters?

明天过后 2024-07-16 19:08:42

我有类似的问题,如果你的标题是正确的。
一旦您建立数据库连接,请使用:

mysqli_set_charset ( $mysqli,'utf8'); 

$mysqli->set_charset("utf8");

I had similar problem, if your headers are correct.
once you made your database connection use:

mysqli_set_charset ( $mysqli,'utf8'); 

or

$mysqli->set_charset("utf8");
北座城市 2024-07-16 19:08:42

问题是您的连接排序规则未设置为 utf-8(很可能是 latin1),而您需要显示日语字符。 您可以通过发出查询来手动设置它:

SET CHARACTER SET utf8;
SET NAMES utf8;

或者在 MySQL 配置文件中:

default-character-set=utf8
skip-character-set-client-handshake

The problem is that your connection collation is not set to utf-8 (most probably latin1), which you need to display the Japanese characters. You could set it manually by issuing the queries:

SET CHARACTER SET utf8;
SET NAMES utf8;

Or in your MySQL configuration file:

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