Skip to content

Conversation

@tooru
Copy link

@tooru tooru commented Dec 23, 2017

nodezip-cli.js has a garbled problem for multi-byte characters.

zip.file(filepath, fs.readFileSync(filepath, 'binary'));

fs.readFileSync returns string content of filepath decoded as 'latin1' ('binary' is alias), then zip.file treats its string content as "utf-8" (see jszip v2.5.0 lib/objects.js).

To solve it, you remove the second argument 'binary'. Then it will be treated as binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant