Skip to content

Commit

Permalink
Merge pull request #2 from srappel/specify-utf8
Browse files Browse the repository at this point in the history
Specify utf8
  • Loading branch information
karenmajewicz authored Mar 7, 2024
2 parents 5a9b61e + 6e11f88 commit 15d2227
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 1.0-to-aardvark.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Load the crosswalk.csv and make it a dictionary

crosswalk = {}
with open(dir_crosswalk) as f:
with open(dir_crosswalk, encoding='utf8') as f:
reader = csv.reader(f)
fields = next(reader)
for record in reader:
Expand All @@ -24,7 +24,7 @@
# Function to update the metadata schema
def schema_update(filepath):
# Open the JSON file with schema GBL 1.0
with open(filepath) as fr:
with open(filepath, encoding='utf8') as fr:
# Load its content and make a new dictionary
data = json.load(fr)

Expand All @@ -38,7 +38,7 @@ def schema_update(filepath):

# Write updated JSON to a new folder
filepath_updated = dir_new_schema + file
with open(filepath_updated, 'w') as fw:
with open(filepath_updated, 'w', encoding='utf8') as fw:
j = json.dumps(data, indent=2)
fw.write(j)

Expand Down

0 comments on commit 15d2227

Please # to comment.