From d2345a94f8df2f01063637dad1d552a5a42391a0 Mon Sep 17 00:00:00 2001 From: pictuga Date: Sat, 7 Dec 2013 20:35:32 +0100 Subject: [PATCH] Speed up a little html encoding detection Not sure this is a smart move --- morss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/morss.py b/morss.py index 651be29..4099a0e 100644 --- a/morss.py +++ b/morss.py @@ -308,7 +308,7 @@ def detEncoding(data, con=None): log('header') return con.headers.getparam('charset') - match = re.search('charset=["\']?([0-9a-zA-Z-]+)', data) + match = re.search('charset=["\']?([0-9a-zA-Z-]+)', data[:1000]) if match: log('meta.re') return match.groups()[0]