Kent Johnson wrote: > Something like > data = urllib.url_open(...).read() > unicodeData = data.decode('gb2312') > utf8Data = unicodeData.encode('utf-8') > > You may want to supply the errors parameter to decode() or encode(); see > the docs for details. > http://docs.python.org/lib/string-methods.html
In addition, for an HTML page, you might need to update the META element for the content-type HTTP header. For an XHTML page, you might need to update/remove the XML declaration. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list