[問題] unicode to big5
問一個笨問題
t=u'\u6211'
print t --> 我
如果有一網頁上有 \u6211 這樣的字串,那如何抓下來後轉成big5呢
response = urllib2.urlopen(...
html=response.read()
html --> '\\u6211'
print html.encode('big5','ignore') --> '\u6211' 要如何得到"我"呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.161.246.198
→
06/18 23:17, , 1F
06/18 23:17, 1F
→
06/18 23:17, , 2F
06/18 23:17, 2F
推
06/18 23:45, , 3F
06/18 23:45, 3F
Python 近期熱門文章
PTT數位生活區 即時熱門文章