You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like encoding for request is used when getting text for the response data. Fetch is a browser-first implementation that explicitly is designed for UTF-8 so you'll want to fall back to DataView and TextEncoding APIs (or use polyfills).
const ab = await (await r2.get(url).response).arrayBuffer();
const dataView = new DataView(ab); // May only need this in the browser, use ab in place if so.
const decoder = new TextDecoder('latin1');
console.log(decoder.decode(dataView));
Using
request
, I can add options about encoding:encoding: 'latin1'
. Is it possible withr2
?The text was updated successfully, but these errors were encountered: