Bad CHARSET in filenames of zip archives, created with ubuntu

Bug #396605 reported by Murz
62
This bug affects 13 people
Affects Status Importance Assigned to Milestone
p7zip (Ubuntu)
Confirmed
Undecided
Unassigned
zip (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I try to create a zip archive on Ubuntu (using Ubuntu 9.04 AMD64) with non-latin symbols in filename that opens correctly on Windows XP but can't do it.

All non-latin (Russian) symbols shows in Windows XP (I try standart support of ZIP in WinXP and 7zip on windows) bad.

For example, I create the file named "тестовый_файл.txt" and try to pack via standart zip and 7z:
$ 7z a ./test_linux_7z.zip ./тестовый_файл.txt
$ zip -r ./test_linux_zip.zip ./тестовый_файл.txt

And I try to create the archive on Windows XP via internal zip (test_win_winxp.zip) and 7zip (test_win_7z.zip)

After that I can correctly view the filename in all files in Linux:
$ unzip -l ./test_linux_zip.zip
        4 07-07-09 18:49 тестовый_файл.txt
$ unzip -l ./test_linux_7z.zip
        4 07-07-09 18:49 тестовый_файл.txt
$ unzip -l ./test_win_winxp.zip
        4 07-07-09 18:49 тестовый_файл.txt
$ unzip -l ./test_win_7z.zip
        4 07-07-09 18:49 тестовый_файл.txt

But on WINDOWS I try to list filenames in archives that created on linux, but it shows bad:

E:\murz\arch>"C:\Program Files\7-Zip\7z.exe" l test_linux_zip.zip
7-Zip 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06
   Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2009-07-07 18:49:14 ..... 4 4 С'РчС_С'Р_Р_С<Р№_С"айР>.txt
------------------- ----- ------------ ------------ ------------------------

E:\murz\arch>"C:\Program Files\7-Zip\7z.exe" l test_linux_7z.zip
2009-07-07 18:49:14 ..... 4 4 С'РчС_С'Р_Р_С<Р№_С"айР>.txt

E:\murz\arch>"C:\Program Files\7-Zip\7z.exe" l test_win_winxp.zip
2009-07-07 18:49:14 ..... 4 4 тестовый_файл.txt

E:\murz\arch>"C:\Program Files\7-Zip\7z.exe" l test_win_7z.zip
2009-07-07 18:49:14 ....A 4 4 тестовый_файл.txt

And if I try to list via Windows internal zip, I see bad filename too (results are on attached screenshot).

I have attached to bug all created files for testing.

How I can correctly create a zip archive on Ubuntu that normally extracts on windows?

Revision history for this message
Murz (murznn) wrote :
Revision history for this message
Murz (murznn) wrote :
Revision history for this message
Murz (murznn) wrote :
Revision history for this message
Murz (murznn) wrote :
Revision history for this message
Murz (murznn) wrote :
tags: added: charset codepage cp1251 cp866 russian zip
Revision history for this message
Murz (murznn) wrote :

I searched that for correct filenames in zip on Windows it must be stored in DOS (CP866) encoding. But I can't find how to force zip command create filenames in DOS encoding.

Command unzip have an options for working with DOS encoding:
$ unzip --help
  -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives
  -I CHARSET specify a character encoding for UNIX and other archives

But zip didn't work with this options:
$ zip -O DOS -r ./test2.zip ./тестовый_файл.txt
zip error: Invalid command arguments (no such option: O)

Changed in zip (Ubuntu):
status: New → Confirmed
Revision history for this message
Murz (murznn) wrote :

I have tested this bug on Arch Linux Live CD (2009.02) and it have no problems! Locale is ru_RU.UTF-8, I have created a test file "тестовый_файл.txt", pack it with Context menu of Konqueror to zip, and after that it correctly unpacked on Windows XP. File, created with archlinux, is attached.
I think we need to compare sources of zip in ArchLinux and Ubuntu for find solution. If I found something, I'll post here.

Revision history for this message
Murz (murznn) wrote :

Sorry, posted before is about Alt Linux LiveCD (4.1.1) and zip file is from it too. Tested with altlinux-4.1.1-desktop-x86_64-live-cd.iso

Revision history for this message
brg (bragovo) wrote :

Confirm this bug.

Revision history for this message
Jan Nekvasil (jan-nekvasil) wrote :

This bug is still present on Lucid Alpha 3, zip 3.0-2. I have to use Windows XP (in VirtualBox) to do something such basic as creating a zip archive containing filesnames with non-ASCII characters. It's very hard to explain to somebody that Ubuntu is a modern and fully functional OS then.

Revision history for this message
Bremm (bremm) wrote :

Same problem here regarding extended latin characters (á, â, ô, ó etc.).

A workaround can be done installing Wine and the latest WinZip (or WinRAR).

Revision history for this message
growingneeds (growingneeds) wrote :

This problem exists for me. It's quite irritating. I now try to zip files from windows.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in p7zip (Ubuntu):
status: New → Confirmed
Revision history for this message
h1bymask (h1bymask) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "p7zip-9.20.1-manual-iconv-lc_dos.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.