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

时间:2023-01-06 11:35:17

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.

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

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 ????.

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

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?

我的另一个问题是这些字段是否可以搜索?我的意思是如果该字段包含一些日文字符并且我输入sayuri作为关键字,日语字符是否等同于他们的音节用英语发音?

3 个解决方案

#1


1  

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?

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

#2


0  

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:

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

SET CHARACTER SET utf8;
SET NAMES utf8;

Or in your MySQL configuration file:

或者在MySQL配置文件中:

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

#3


0  

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");

#1


1  

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?

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

#2


0  

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:

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

SET CHARACTER SET utf8;
SET NAMES utf8;

Or in your MySQL configuration file:

或者在MySQL配置文件中:

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

#3


0  

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");