mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-17 06:11:35 +01:00
Fixed read iso-8859-1 files
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
3a7f53c00b
commit
91fe0a9789
1 changed files with 4 additions and 2 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue