Where to locate existing standard encodings in python
Tim Chase
python.list at tim.thechases.com
Tue Nov 11 18:07:51 EST 2008
> You haven't explained why you think that you *need* a list of all
> encodings that exist at a point in time. What are you going to do with
> the list?
Just because I ran into this recently, the Dilbert.com site
returns a bogus Content-type header with
Content-Type: text/html; charset=utf-8lias
For Python to parse this, I had to use Python's list of known
encodings in order to determine whether I could even parse the
site (for passing it to a string's .encode() method). (Aside:
stupid dilbert.com site developers...what sorta rubbish is
"utf-8lias"?! It's not like it's something that would appear
accidentally. And there were bogus characters in the document to
boot)
-tkc
More information about the Python-list
mailing list