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

Properly decode UTF-16BE, UTF-16LE and UTF-8 with BOM #160

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

ikreymer
Copy link
Member

If BOM is present in the text, decode correctly in ArchiveResponse.getText()

Use Buffer.toString() for UTF-16 (swap for utf16be) and just remove bom for UTF-8, as decoding already handled by TextDecoder.

Fixes #154 and #155

…ponse.getText(), ensure proper decoding based

on the BOM. For UTF-8, simply remove the BOM, as UTF-8 already handled. For UTF-16, use Buffer.toString()
Fixes #154 and #155
@ikreymer ikreymer changed the title Properly decode UTF-16BE, UTF-16LE and UTF-8 with BOM (baesd Properly decode UTF-16BE, UTF-16LE and UTF-8 with BOM Feb 18, 2024
@ikreymer ikreymer merged commit de61e6d into main Feb 22, 2024
1 of 2 checks passed
@ikreymer ikreymer deleted the bom-utf16-utf8-check branch February 22, 2024 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant