Fixed read iso-8859-1 files

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2020-01-16 12:10:01 +01:00
parent 3a7f53c00b
commit 91fe0a9789

View file

@ -59,9 +59,11 @@ class Utils:
def read_file(self, registry): def read_file(self, registry):
"""Returns reading file """Returns reading file
""" """
with open(registry, "r") as file_txt: code = self.check_encoding('', registry)
if not code:
code = "utf-8"
with open(registry, "r", encoding=code) as file_txt:
read_file = file_txt.read() read_file = file_txt.read()
file_txt.close()
return read_file return read_file
def package_name(self, PACKAGES_TXT): def package_name(self, PACKAGES_TXT):