summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2022-06-13 01:09:28 +0200
committeremkael <emkael@tlen.pl>2022-06-13 01:09:28 +0200
commit31dce78496a3049327c38bb2793aa9b553e2037c (patch)
tree40d4f02b75e06dc60e955acd237b4d4e8a1ad9a7
parent936590dbdf4e78f7ffe06b5b7858d23e38b600ec (diff)
parentc51a0a4fefb6fb9e8ca088244891ad0826ba514b (diff)
Merge branch 'pbn-charset-detection'
-rw-r--r--dealconvert/formats/html.py4
-rw-r--r--requirements.txt1
2 files changed, 5 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:]
diff --git a/requirements.txt b/requirements.txt
index 6d68c60..4c3b9ce 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1 +1,2 @@
pdfkit == 0.6.1
+chardet == 4.0.0