From 0990f16f7f2efa933ccd34eb51bcb27ac8bb7f84 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 12 Jun 2011 08:36:21 +0000 Subject: [PATCH] minor update for invalid cases like 'iso-8859-1 (western europe)' --- lib/request/basic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/request/basic.py b/lib/request/basic.py index f6097f13e..c9c7658cf 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -99,9 +99,9 @@ def checkCharEncoding(encoding): # http://www.destructor.de/charsets/index.htm translate = { 'windows-874': 'iso-8859-11', 'en_us': 'utf8', 'macintosh': 'iso-8859-1', 'euc_tw': 'big5_tw' } - for delimiter in (';', ','): + for delimiter in (';', ',', '('): if delimiter in encoding: - encoding = encoding[:encoding.find(delimiter)] + encoding = encoding[:encoding.find(delimiter)].strip() # popular typos/errors if '8858' in encoding: