Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not raise an error when parsing a wrong encoding (nodejs) #657

Closed
StroginA opened this issue May 9, 2022 · 2 comments · Fixed by #735
Closed

Does not raise an error when parsing a wrong encoding (nodejs) #657

StroginA opened this issue May 9, 2022 · 2 comments · Fixed by #735

Comments

@StroginA
Copy link

StroginA commented May 9, 2022

I have created an .env file in utf16-LE and was unaware of it. When trying to parse it (using the default encoding option of utf8), dotenv did not raise any errors neither in require('dotenv').config().error, not when using { debug: true }. Instead, require('dotenv').config().parsed was simply empty. This was frustratingly difficult to track down.

@motdotla
Copy link
Owner

That is frustrating. I'll slot this in soon to be fixed up.

@anthonyshibitov
Copy link
Contributor

I'll take a stab at this.

anthonyshibitov added a commit to anthonyshibitov/dotenv that referenced this issue May 14, 2023
If no encoding is specified in the options, debug will alert the user that
UTF-8 will be used as the default.

Closes motdotla#657
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 a pull request may close this issue.

3 participants