question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

filenames with Unicode characters are corrupt

See original GitHub issue

Similar to another issue, filenames with Unicode characters are unusable: 7-zip can neither read nor extract them.

For example:

Tal/A L'infini/Le Passé.txt -> Tal/A L'infini/Le Pass├⌐.tx

Snøfall.txt -> Sn├╕fall.tx

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:19

github_iconTop GitHub Comments

7reactions
5saviahvcommented, Nov 16, 2020

I just tested this code, little modified example code and for my surprise

  1. if Bit 11 is set but mode is not written - GUI tools understand filenames, but command line tools doesn’t. .
  2. if Bit 11 is not set and mode is Unix - command line tools understand file names, but GUI tools doesn’t.
  3. if Bit 11 is set and mode is Unix - Both GUI and command line command line tools understand file names .
#!/usr/bin/env node

const AdmZip = require('adm-zip');

const zip = new AdmZip();

// add file directly
const content = "inner content of the file";
//zip.addFile("äää.txt", Buffer.from(content), "entry comment goes here");
zip.addFile("你好.txt", Buffer.from(content), "entry comment goes here");

zip.getEntries().forEach(entry => {
    entry.header.made = 0x314;
    entry.header.flags |= 0x800;   // Set bit 11 - APP Note 4.4.4 Language encoding flag (EFS)
});

const willSendthis = zip.toBuffer();

zip.writeZip('./test-utf8.zip');

for GUI tools I used only Gnome Archive Manager. I also used google drive for testing but it detected correct names with every try.

5reactions
SETA-thanhntcommented, Dec 13, 2018

I have same problem. Have you solved this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Files with names with unicode characters get corrupted in SD ...
Examples of filenames that cause folder corruption are "Aṣa" or "דניאל". It makes no difference if the file was copied to the card...
Read more >
Fix corrupted Unicode file names in a zip archive - Super User
Are you sure the file names are corrupt because this sounds more of a OS X problem then a corrupt zip archive problem....
Read more >
Invalid characters in filename cause storage report to be corrupt
Certain XML characters in file names cause problems for Excel. ... you will see the invalid XML/Unicode characters at the specified column.
Read more >
Filename Characters Are Corrupted - Qnap Advanced Support
2 – Go to Network Services -> FTP Service, click on “Unicode Support” and press Apply. This Should fix your problem.
Read more >
Windows file names displayed corrupted characters in Linux
Dupe of other questions: stackoverflow.com/questions/9974779/… · Feb 18, 2017 at 9:45 ; Do an Internet search for "zip file and unicode filenames" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found