问题描述
我在包含阿拉伯文字的 MySQL 数据库中插入了数据.虽然输出正确显示阿拉伯语,但 MySQL 中的数据看起来很垃圾.像这样:
I inserted data in a MySQL database which includes Arabic script. While the output displays Arabic correctly, the data in MySQL looks like garbage. Something like this:
'صَومُ ثَلاثَةِ أيّامٍ مِن كُلِّ شَهرٍ ـ أربَعاءُ بَينَ خَ
我应该担心这个吗?如果是,我如何让它在 MySQL 中以正确的阿拉伯语脚本显示?
Should I be worried about this? If yes, how do I make it appear in proper Arabic script in MySQL?
推荐答案
那些是 HTML 实体.
Those are HTML entities.
如果这个文字
صَومُ ثَلاثَةِ أيّامٍ مِن كُلِّ شَهرٍ ـ أربَعاءُ بَينَ خَ
صَومُ ثَلاثَةِ أيّامٍ مِن كُلِّ شَهرٍ ـ أربَعاءُ بَينَ خَ
应该是您的数据库中的内容,一切很可能没问题:您的阿拉伯语输入会在此过程中的某个时刻转换为这些实体.
is what is supposed to be in your database, everything's most likely fine: Your arabic input gets converted into those entities at some point along the way.
要像上面一样查看实际的阿拉伯字符,请将它们插入一个文本文件中,将其命名为 something.htm
并在浏览器中打开它.
To view the actual arabic characters like above, insert them into a text file, name it something.htm
and open it in your browser.
您也可以将其转换为 UTF-8 编码的 mySQL 表中的正确"本机字符,但要获得任何指示,您必须告诉我们您正在使用的语言/平台.
You could also convert it into "proper" native characters in a UTF-8 encoded mySQL table, but for you to get any pointers how to do that you would have to tell us what languages/platforms you are working with.
这篇关于MySQL 中的阿拉伯语脚本错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!