Skip to content

non-english characters file name become gibberish when using .getEntries() #542

Answered by 0f-0b
chaintng asked this question in Q&A
Discussion options

You must be logged in to vote

The filenames in the archive are encoded in UTF-8, but the language encoding flag that indicates such isn't set, so zip.js instead tries to decode the filenames as if they are encoded in CP437, resulting in gibberish. This problem was discussed in detail in #131.

The easiest way to fix this is to set the filenameEncoding option to "utf-8" (table of all supported values). This tells zip.js to decode the filenames as UTF-8 even in the absence of the language encoding flag. For more control over how the filenames are decoded, you can use the decodeText option or read the rawFilename property.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@gildas-lormeau

This comment was marked as off-topic.

@chaintng
Comment options

Answer selected by chaintng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #541 on November 14, 2024 15:06.