-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
I expected both of these types of input (a string, and a Promise that resolves to a string) to produce the same output:
var zip = new JSZip();
zip.file("file.txt", "Hèllo");
const output = await zip.file("file.txt").async("text");
// Hèllo
var zip = new JSZip();
zip.file("file.txt", Promise.resolve("Hèllo"));
const output = await zip.file("file.txt").async("text");
// H�llo
but the second version (where the input string is wrapped in a Promise) produces output text with incorrect encoding unless you explicitly set { binary: false }
:
var zip = new JSZip();
zip.file("file.txt", Promise.resolve("Hèllo"), { binary: false });
const output = await zip.file("file.txt").async("text");
// Hèllo
Metadata
Metadata
Assignees
Labels
No labels