使用.gz格式的Unicode字符(阿拉伯语和库尔德语)还原MySQL DB [英] Restore MySQL DB with Unicode characters (Arabic and Kurdish) in .gz format
问题描述
我有一个.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.
例如,数据库中的实际数据为: كامپىزانكۆ ,还原后显示的数据变为: بÙâزا ÙÙÛÛâ
For example, the real data in DB is : كامپى زانكۆ and the data showed after the restoring become to this : بÙâزاÙÙÛÛâ
推荐答案
这是一个相当普遍的问题,由创建和导出数据库时的编码方案不一致引起.这是解决问题的最简单方法:
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
. - 导入编辑的文件.
- Import your backup file
- Export it again, but using
latin1
encoding - Manually edit the exported file, change all occurrences of
latin1
toutf8
. - Import the edited file.
这篇关于使用.gz格式的Unicode字符(阿拉伯语和库尔德语)还原MySQL DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!