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

UTF16-LE files can't be parsed #25

Closed
Bios-Marcel opened this issue Aug 12, 2023 · 0 comments · Fixed by #26
Closed

UTF16-LE files can't be parsed #25

Bios-Marcel opened this issue Aug 12, 2023 · 0 comments · Fixed by #26

Comments

@Bios-Marcel
Copy link
Contributor

Bios-Marcel commented Aug 12, 2023

I have written a .env file via PowerShell, using echo "X=Z" >> file.env. This produces a UTF16 file with a little endian BOM byte encoded in UTF-16.

I will try to fix this with a PR.

@Bios-Marcel Bios-Marcel changed the title Files with BOM bytes can't be parsed UTF16-LE files can't be parsed Aug 12, 2023
Bios-Marcel added a commit to Bios-Marcel/gotenv that referenced this issue Aug 12, 2023
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
Bios-Marcel added a commit to Bios-Marcel/gotenv that referenced this issue Aug 14, 2023
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
luisdavim pushed a commit that referenced this issue Aug 14, 2023
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
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.

1 participant