fix for a bug reported by Marek Sarvas

This commit is contained in:
Miroslav Stampar
2010-07-26 08:11:28 +00:00
parent 4464d73856
commit 6a6ff09c9a
2 changed files with 6 additions and 1 deletions

View File

@@ -100,8 +100,10 @@ def checkCharEncoding(encoding):
translate = { 'windows-874':'iso-8859-11' }
#http://philip.html5.org/data/charsets-2.html
if encoding and encoding.startswith('cp-'):
if encoding.startswith('cp-'):
encoding = 'cp%s' % encoding[3:]
elif ';' in encoding:
encoding = encoding[:encoding.find(';')]
elif encoding in translate:
encoding = translate[encoding]
try: