Commit e592af7f authored by Administrator's avatar Administrator

[BUG FIX] Latin1 encoding issue resolved :)

parent 8e08ba93
......@@ -25,12 +25,14 @@ class EuropressFileParser(FileParser):
#return []
encoding = self.detect_encoding(contents)
#print(encoding)
#if encoding != "utf-8":
try:
contents = contents.decode(encoding, errors='replace').encode(codif)
except Exception as error:
print(error)
pass
if encoding != "utf-8":
try:
contents = contents.decode("latin1", errors='replace').encode(codif)
except :
try:
contents = contents.decode(encoding, errors='replace').encode(codif)
except Exception as error:
print(error)
try:
html_parser = etree.HTMLParser(encoding=codif)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment