From d0d5ee813263c7f4fff80f5ec953bd6645ffc61e Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 14 Mar 2009 22:02:20 +0100 Subject: [PATCH] get basic utf-8 case right --- oxlib/net.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oxlib/net.py b/oxlib/net.py index ebeb515..774b480 100644 --- a/oxlib/net.py +++ b/oxlib/net.py @@ -64,6 +64,8 @@ def getUrlUnicode(url): return unicode(data, encoding) def getEncoding(data): + if 'content="text/html; charset=utf-8"' in data: + return 'utf-8' detector = UniversalDetector() for line in data.split('\n'): detector.feed(line)