問題描述
所以我目前正在從事某個項目,我需要創建一個數據庫,其中的記錄將同時包含英語和阿拉伯語名稱.
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 中不顯示阿拉伯字符的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!