問題描述
我在包含阿拉伯文字的 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 中的阿拉伯語腳本錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!