fix(salary): accept BOM-prefixed UTF-8 data files (#602)

* fix(salary): accept BOM-prefixed UTF-8 data files

Fixes #594. Thanks to @rahul05ranjan for reporting the failure and identifying the decoder change.

* docs(changelog): entry for #602

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-17 20:06:36 +02:00
1 parent 1b22a38d3f
commit 822d19a2ba
3 files changed
+57 -1

No files matched your search

+1 -1
View File
@@ -149,7 +149,7 @@ def read_raw_data():
print("step will be skipped during /apply.", file=sys.stderr)
sys.exit(1)
try:
with open(DATA_FILE, "r", encoding="utf-8") as f:
with open(DATA_FILE, "r", encoding="utf-8-sig") as f:
data = json.load(f)
except json.JSONDecodeError as exc:
fail_data_error(f"invalid JSON at line {exc.lineno}, column {exc.colno}: {exc.msg}")