Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed garbled problem. #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fixed garbled problem. #27

wants to merge 1 commit into from

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