Skip to content

Commit 7353f2b

Browse files
committed
fix encoding for entsoe file library
1 parent 2bb2242 commit 7353f2b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

entsoe/entsoe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
warnings.filterwarnings('ignore', category=XMLParsedAsHTMLWarning)
2727

2828
__title__ = "entsoe-py"
29-
__version__ = "0.7.3"
29+
__version__ = "0.7.4"
3030
__author__ = "EnergieID.be, Frank Boerman"
3131
__license__ = "MIT"
3232

entsoe/files/entsoe_files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def download_single_file(self, folder, filename) -> pd.DataFrame:
119119
stream.seek(0)
120120
zf = zipfile.ZipFile(stream)
121121
with zf.open(zf.filelist[0].filename) as file:
122-
return pd.read_csv(file, sep='\t', encoding='unicode_escape')
122+
return pd.read_csv(file, sep='\t', encoding='utf-8-sig')
123123

124124
@check_expired
125125
def download_multiple_files_raw(self, file_ids: list) -> bytes:
@@ -148,6 +148,6 @@ def download_multiple_files(self, file_ids: list) -> pd.DataFrame:
148148
df = []
149149
for fz in zf.filelist:
150150
with zf.open(fz.filename) as file:
151-
df.append(pd.read_csv(file, sep='\t', encoding='unicode_escape'))
151+
df.append(pd.read_csv(file, sep='\t', encoding='utf-8-sig'))
152152

153153
return pd.concat(df)

0 commit comments

Comments
 (0)