From cbfb10cbd109b218e10d9d563e44d03ee4b0e06c Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 21 Mar 2011 16:43:46 +0000 Subject: [PATCH] fix of a minor bug reported by syssecurity7@googlemail.com (missing iso-8858...) --- doc/THANKS | 3 +++ lib/request/basic.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/doc/THANKS b/doc/THANKS index ee99259ee..a19ed9602 100644 --- a/doc/THANKS +++ b/doc/THANKS @@ -500,6 +500,9 @@ Stuffe Sylphid for suggesting some features +syssecurity.info + for reporting a minor bug + ToR for reporting considerable amount of bugs for suggesting a feature diff --git a/lib/request/basic.py b/lib/request/basic.py index a83954f98..0cdf97073 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -103,6 +103,8 @@ def checkCharEncoding(encoding): # http://philip.html5.org/data/charsets-2.html if encoding in translate: encoding = translate[encoding] + elif encoding.startswith('iso-8858'): #very popular typo + encoding = encoding.replace('8858', '8859') elif encoding.startswith('cp-'): encoding = 'cp%s' % encoding[3:] elif encoding.startswith('windows') and not encoding.startswith('windows-'): @@ -110,6 +112,7 @@ def checkCharEncoding(encoding): elif encoding == 'null': return None + # http://www.iana.org/assignments/character-sets try: codecs.lookup(encoding) except LookupError: