问题描述
所以我目前正在从事某个项目,我需要创建一个数据库,其中的记录将同时包含英语和阿拉伯语名称.
So I am currently working on a certain project where I need to create a database in which its records will hold both English and Arabic names.
我使用 PhpMyAdmin 创建它,它对于英文名称非常有效,但是所有阿拉伯名称都显示为?????".
I am creating this using PhpMyAdmin where it works perfectly fine for English names, however all the Arabic names appear as "?????".
为了解决这个问题,我尝试使用set name 'utf8'",但是没有用.谷歌搜索这个问题,我意识到 PhpMyAdmin 不支持阿拉伯语或特殊字符.
To solve this issue I tried to use "set name 'utf8' ", however it didn't work. Googling this problem I realized that PhpMyAdmin does not support either Arabic or Special characters.
我不确定是否有解决此问题的方法.您有什么建议可以解决吗?
I am not sure if there is any workaround for this issue. Do you have any suggestion to solve it ?
提前致谢
推荐答案
首先,您的数据库是否能够存储 Unicode?SHOW CREATE TABLE table_name;
希望将您的字符集显示为 utf8.如果不是,这应该解决它:
First, is your database capable of storing Unicode? SHOW CREATE TABLE table_name;
will hopefully show your character set as utf8. If not this should fix it:
ALTER TABLE table_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
还要确保您的 PHPMyAdmin 设置包含以下内容:
Also make sure your PHPMyAdmin settings contain this:
$cfg['DefaultCharset'] = 'utf_8';
$cfg['DefaultConnectionCollation'] = 'utf8_general_ci';
这篇关于phpMyAdmin 中不显示阿拉伯字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!