-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Description
When using the polyfill on browsers that don't support blob but do support arrayBuffer, multibyte UTF-8 sequences don't get decoded properly.
Simple repro, you can mock the browser environment by forcefully setting support.blob false:
fetch('data:text/plain,èàì’')
.then(r => r.text())
.then(console.log) // logs "èà ì�"Looks like this was introduced here in v3.6.15, it works alright previously. With that responseType always set, Body's text() runs the byte by byte buffer decode with String.fromCharCode(), which can't handle the multibyte sequences.
Would it make sense to only set xhr.responseType after the response headers arrive, so it can check the Content-Type as well as browser support?
Metadata
Metadata
Assignees
Labels
No labels