最近再嚐試理解Python 2.7的編碼機制
使用下面程式碼在win 7 cmd line下測試會報錯 Errno 2 No such file or directory
不太能理解,我以為這是open file時找不到檔名的錯誤訊息,煩請高手指點一下~
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
str_ch = '中文測試'.decode('utf-8')
print str_ch