
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tlug] handling ZIP files with local filename encodings (Shift_JIS) on Linux
- Date: Mon, 17 Dec 2012 16:37:40 +0900
- From: Kalin KOZHUHAROV <me.kalin@example.com>
- Subject: [tlug] handling ZIP files with local filename encodings (Shift_JIS) on Linux
Hello,
For some time I have been fighting with a design constraint of the ZIP
file format - filenames are stored in "local" encoding by default. So
on Windoze systems in Japan that happens to be Shift_JIS...
The source of those files is outside my control, so using other formats is NG.
Right now I deal with them as follows:
# locale
LANG=
LC_CTYPE=ja_JP.UTF-8
LC_NUMERIC=C
LC_TIME=C
LC_COLLATE=ja_JP.UTF-8
LC_MONETARY=ja_JP.UTF-8
LC_MESSAGES=C
LC_PAPER=C
LC_NAME=C
LC_ADDRESS=C
LC_TELEPHONE=C
LC_MEASUREMENT=C
LC_IDENTIFICATION=C
LC_ALL=
# LC_ALL=ja_JP.Shift_JIS 7z x whatever.zip
[borked output snip]
# convmv --nosmart -r -f shift-jis -t utf8 *
[make sure * matches what you need]
# convmv --notest --nosmart -r -f shift-jis -t utf8 *
[if the above command worked you should have proper UTF-8 filenames]
So far this approach works (I think I had a problem only once, but
forgot details), it is a bit tedious and I don't want to simply script
it, ignoring the test run.
Is there any other more intelligent way of doing it?
Any simple apps that do this properly? (prefer CLI)
I have been thinking to patch 7z to add "--filename-encoding", but
have been lazy so far...
( also http://sourceforge.net/p/sevenzip/bugs/396/ that I found)
Cheers,
Kalin.
Home |
Main Index |
Thread Index