When a JavaScript is UTF-16 BE/LE encoded with or without a BOM (Byte Order Marker), the respective JavaScript is not processed.
The function parseLetConstGlobals(text) is not called because the async getText(isUTF8=false) function in response.js does not examine the read buffer to determine which encoding is applicable. The internal browser JavaScript parser does have this functionality. I have added an example Warc file.
utf8-utf16-js-test.warc.gz
When a JavaScript is UTF-16 BE/LE encoded with or without a BOM (Byte Order Marker), the respective JavaScript is not processed.
The function parseLetConstGlobals(text) is not called because the async getText(isUTF8=false) function in response.js does not examine the read buffer to determine which encoding is applicable. The internal browser JavaScript parser does have this functionality. I have added an example Warc file. utf8-utf16-js-test.warc.gz