Skip to content

json_read_from_file to skip the BOM bytes before deserialize the content.#348

Merged
ZhidongPeng merged 2 commits into
Azure:devfrom
ZhidongPeng:bom
May 19, 2026
Merged

json_read_from_file to skip the BOM bytes before deserialize the content.#348
ZhidongPeng merged 2 commits into
Azure:devfrom
ZhidongPeng:bom

Conversation

@ZhidongPeng
Copy link
Copy Markdown
Collaborator

Read the whole file to bytes so we can transparently skip an optional UTF-8 BOM (EF BB BF). serde_json does not strip a BOM and would otherwise fail the parse with "expected value at line 1 column 1" for any file produced by editors / tools that default to BOM-prefixed UTF-8 (e.g. Windows PowerShell 5.1's Set-Content -Encoding UTF8, Notepad, VS Code's "UTF-8 with BOM").

@ZhidongPeng ZhidongPeng merged commit 302a821 into Azure:dev May 19, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants