[2.5.1] ShiftJIS to Unicode?
nospam at nospam.com
Thu Nov 27 01:17:23 CET 2008
I'm trying to read pages from Amazon JP, whose web pages are
supposed to be encoded in ShiftJIS, and decode contents into Unicode
to keep Python happy:
<meta http-equiv="content-type" content="text/html; charset=Shift_JIS"
But this doesn't work:
m = try.search(the_page)
#UnicodeEncodeError: 'charmap' codec can't encode characters in
position 49-55: character maps to <undefined>
title = m.group(1).decode('shift_jis').strip()
Has someone successfully accessed Shift-JIS-encoded Japanese contents
More information about the Python-list