webrecorder / wabac.js

wabac.js - Web Archive Browsing Augmentation Client
https://replayweb.page
GNU Affero General Public License v3.0
96 stars 17 forks source link

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

Closed ikreymer closed 5 months ago

ikreymer commented 5 months ago

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