問題描述
我有一個 .gz
格式的 MySQL 備份文件,它是由 cPanel 中的備份向導創建的.當備份向導完成恢復時,即使我在 PhpMyadmin 中將排序規則更改為不同的 UTF-8 編碼,也無法正確顯示帶有阿拉伯語和庫爾德語字符的內容.
I have a MySQL backup file in .gz
format that was created by the backup wizard in cPanel.
When the restoration is done by the backup wizard, contents with Arabic and Kurdish characters do not show correctly, even though I changed the collation to different UTF-8 encoding in PhpMyadmin.
例如,DB中的真實數據為:????? ?????,恢復后的數據顯示為:?¨ùa?2?§ùù???a
For example, the real data in DB is : ????? ????? and the data showed after the restoring become to this : ?¨ùa?2?§ùù??a
推薦答案
這是在創建和導出數據庫時由不一致的編碼方案引起的一個相當普遍的問題.這是解決它的最簡單方法:
This is a fairly common problem caused by inconsistent encoding schemes when creating and exporting the database. Here is the simplest way to solve it:
- 導入您的備份文件
- 再次導出,但使用
latin1
編碼 - 手動編輯導出的文件,將所有出現的
latin1
更改為utf8
. - 導入編輯過的文件.
這篇關于使用 .gz 格式的 Unicode 字符(阿拉伯語和庫爾德語)恢復 MySQL 數據庫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!