Message61263
| Author |
edemaine |
| Recipients |
| Date |
2006年11月19日.19:47:30 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
Currently, urllib.urlopen(...).read() returns a string, not a unicode object. Ditto for urllib2. No attempt is made to decode the data using the charset encoding specified in the header ....info()['Content-Type'].
Is it fair to assume that, in Python 3K, urllib....read() will return (Unicode) strings instead of bytes, automatically decoding according to the charset?
Do you think we could expose this futuristic functionality in Python 2? I doubt we could change read() without breaking a lot of existing code that already does this decoding (e.g., http://zesty.ca/python/scrape.py), but perhaps a 'uread()' method could return a unicode object instead of a string. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2008年01月20日 09:59:51 | admin | link | issue1599329 messages |
| 2008年01月20日 09:59:51 | admin | create |
|