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

Support reading UTF16 files #26

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

Bios-Marcel
Copy link
Contributor

To allow this, we need to use a different scanner that ignores the respective BOM bytes possible to occur. This means \xFFEE and \xFEFF since UTF16 can both be little endian or big endian.

By default, Windows uses UTF16 little endian.

Fixes #25

gotenv.go Show resolved Hide resolved
To allow this, we need to use a different scanner that ignores the
respective BOM bytes possible to occur. This means \xFFEE and \xFEFF
since UTF16 can both be little endian or big endian.

By default, Windows uses UTF16 little endian.

Fixes subosito#25
Copy link
Collaborator

@luisdavim luisdavim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@luisdavim luisdavim merged commit 0a22e48 into subosito:master Aug 14, 2023
Bios-Marcel added a commit to Bios-Marcel/gotenv that referenced this pull request Aug 15, 2023
This was broken in PR subosito#26. Since there was previously no test for this
case, I added a regression test.
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.

UTF16-LE files can't be parsed
2 participants