問題描述
我在包含阿拉伯文字的 MySQL 數(shù)據(jù)庫(kù)中插入了數(shù)據(jù).雖然輸出正確顯示阿拉伯語,但 MySQL 中的數(shù)據(jù)看起來很垃圾.像這樣:
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:
'صَومُ ثَلاثَةِ أيّامٍ مِن كُلِّ شَهرٍ ـ أربَعاءُ بَينَ خَ
我應(yīng)該擔(dān)心這個(gè)嗎?如果是,我如何讓它在 MySQL 中以正確的阿拉伯語腳本顯示?
Should I be worried about this? If yes, how do I make it appear in proper Arabic script in MySQL?
推薦答案
那些是 HTML 實(shí)體.
Those are HTML entities.
如果這個(gè)文字
????? ???????? ?????? ??? ????? ????? ? ???????? ????? ??
????? ???????? ?????? ??? ????? ????? ? ???????? ????? ??
應(yīng)該是您的數(shù)據(jù)庫(kù)中的內(nèi)容,一切很可能沒問題:您的阿拉伯語輸入會(huì)在此過程中的某個(gè)時(shí)刻轉(zhuǎn)換為這些實(shí)體.
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.
要像上面一樣查看實(shí)際的阿拉伯字符,請(qǐng)將它們插入一個(gè)文本文件中,將其命名為 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.
您也可以將其轉(zhuǎn)換為 UTF-8 編碼的 mySQL 表中的正確"本機(jī)字符,但要獲得任何指示,您必須告訴我們您正在使用的語言/平臺(tái).
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.
這篇關(guān)于MySQL 中的阿拉伯語腳本錯(cuò)誤的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!