0.
你需要的是讓編碼用實際編碼而不是 ascii
1. 對需要 str->unicode 的代碼,可以在前邊寫上 import sys reload(sys) sys.setdefaultencoding('utf8') 把 str 編碼由 ascii 改為 utf8 (或 gb18030)
2. python3 區分了 unicode str 和 byte arrary,并且默認編碼不再是 ascii
posted on 2011-11-07 15:04 LoveBeyond 閱讀(11288) 評論(0) 編輯 收藏 引用
Powered by: C++博客 Copyright © LoveBeyond