Skip to content

fix: handle BOM in iterator APIs - #169

Open
niyue wants to merge 1 commit into
allan2:mainfrom
niyue:bugfix/read-iter-bom
Open

fix: handle BOM in iterator APIs#169
niyue wants to merge 1 commit into
allan2:mainfrom
niyue:bugfix/read-iter-bom

Conversation

@niyue

@niyue niyue commented Jul 19, 2026

Copy link
Copy Markdown

Summary

Fixes #168 by ignoring a UTF-8 BOM when .env content is consumed through the iterator APIs.

Changes

  • Strip the BOM from the first decoded line in the shared iterator path.
  • Apply the same behavior to from_read_iter, from_path_iter, and the existing loading APIs.
  • Handle readers that return the BOM bytes across multiple reads.
  • Add regression tests for both public iterator APIs.
  • Document the fix in the changelog.

How to verify

cargo test --workspace

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.

Iterator APIs fail to parse files with a UTF-8 BOM

1 participant