summaryrefslogtreecommitdiff
path: root/dealconvert/formats/html.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2022-02-19 14:55:48 +0100
committeremkael <emkael@tlen.pl>2022-02-19 14:55:48 +0100
commitc51a0a4fefb6fb9e8ca088244891ad0826ba514b (patch)
treefeda7fc16a7b70bf08cdc3af3fcdde07448b8251 /dealconvert/formats/html.py
parent66d95bb9795f058e67a842a9ba25f7dc3dc0fe47 (diff)
PBN charset auto-detection using chardetpbn-charset-detection
Diffstat (limited to 'dealconvert/formats/html.py')
-rw-r--r--dealconvert/formats/html.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/dealconvert/formats/html.py b/dealconvert/formats/html.py
index 4185c40..efb16ff 100644
--- a/dealconvert/formats/html.py
+++ b/dealconvert/formats/html.py
@@ -1,6 +1,9 @@
from collections import OrderedDict
+import sys
import warnings
+import chardet
+
from bcdd.BCalcWrapper import BCalcWrapper
from bcdd.DDTable import DDTable
from bcdd.Exceptions import FieldNotFoundException
@@ -181,6 +184,7 @@ class HTMLFormat(BinaryFormat):
def get_html_content(self, dealset):
deal_rows = []
event_name = dealset[0].event
+ event_name = event_name.decode(chardet.detect(event_name)['encoding'])
while len(dealset) > 0:
deal_rows.append(dealset[0:self.deals_per_column])
dealset = dealset[self.deals_per_column:]