allan2 / dotenvy

A well-maintained fork of the dotenv crate
MIT License
664 stars 40 forks source link

Support UTF-8 BOM encoding #27

Closed allan2 closed 1 year ago

allan2 commented 1 year ago

Trying to load a .env file with a BOM (\ufeff) will not parse correctly. The BOM should be ignored when parsing.

Relevant #26

sonro commented 1 year ago

I would like to tackle this.

It seems like the best place to check for a BOM is in Iter::load. This is just before the file is read into the BufReader. Would that be acceptable?

allan2 commented 1 year ago

That sounds great!