Skip to content

Commit

Permalink
Enhance Readability of YAML File Output
Browse files Browse the repository at this point in the history
When processing names with umlauts, such as "Maximilian Müller," the output incorrectly converts the umlaut to an escape sequence, resulting in "Maximilian M\xFCller."
  • Loading branch information
SeverusYixin committed Dec 4, 2024
1 parent 4a2f103 commit 6882759
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/data_normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def read_data_from_file(file_path):

def write_data_to_file(data, file_path):
"""
Writes data to a YAML file.
Writes data to a YAML file with improved readability for Unicode characters.
Parameters
----------
Expand All @@ -356,8 +356,8 @@ def write_data_to_file(data, file_path):
The path to the YAML file.
"""
os.makedirs(os.path.dirname(file_path), exist_ok=True)
with open(file_path, 'w') as file:
yaml.dump(data, file, sort_keys=False)
with open(file_path, 'w', encoding='utf-8') as file:
yaml.dump(data, file, sort_keys=False, allow_unicode=True)

def process_file(file_path, spdx_licenses):
"""
Expand Down

0 comments on commit 6882759

Please sign in to comment.