Skip to content

Commit

Permalink
Merge pull request #36 from MattBrst/patch-1
Browse files Browse the repository at this point in the history
Add secondary encoding (cp1252) to GEF reader
  • Loading branch information
EleniSmyrniou authored Oct 14, 2024
2 parents 831a177 + a5964aa commit 30e5dd9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions geolib_plus/gef_cpt/gef_file_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,12 @@ def read_gef(self, gef_file: Path, fct_a: float = 0.8) -> Dict:
inputs from gef file.
"""
# read gef file
with open(gef_file, "r") as f:
data = f.readlines()
try:
with open(gef_file, "r") as f:
data = f.readlines()
except UnicodeDecodeError:
with open(gef_file, "r", encoding='cp1252') as f:
data = f.readlines()

# search NAP
idx_nap = GefFileReader.get_line_index_from_data_starts_with(
Expand Down

0 comments on commit 30e5dd9

Please sign in to comment.