的Ascii解碼錯誤Django的ASCII顯示錯誤
文本= "Hanuman (Sanskrit: हनुमान्, Hanumān), a Hindu deity who was an ardent devotee of Rama according to Hindus legends, and a central character in the Indian epic Ramayana."
我保存的文本到MySQL表novarchar柱,它成功地插入。
當我在控制檯中檢索到這些數據時,它顯示正確。但是,當我試圖通過Django檢索它並將其顯示在模板中時,它顯示爲一些ascii字符。
顯示爲"Hanuman (Sanskrit: हनà¥à¤®à¤¾à¤¨à¥, HanumÄn), is a Hindu deity who is an ardent devotee of Rama, a central character in the Indian epic Ramayana."
請出示一些代碼。模型是什麼樣的?你如何獲取數據?你如何在模板中顯示它?你是如何將它插入的? – 2012-07-09 09:57:39
https://docs.djangoproject.com/zh/dev/ref/unicode/ 請看看 – Khaleel 2012-07-09 10:01:38