the Mac OS X file archiver
Download Changelog Forum Help Trac Project

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#79 closed enhancement (fixed)

Support for LHA

Reported by: Lotusbrod Owned by: aONe
Priority: minor Milestone: Keka 1.0.5
Component: Version:
Keywords: Cc:

Description (last modified by aONe)

Justification for LHA support request

LHA is still commonly used in Japan. Although usually only created by Windows users there is a need to open LHA archives on Macs. I have no information on the extent to which they're used but certainly organisations like the post office still use it for files they provide on their website. The format is also supported by default on Japanese versions of Windows 7 (and possibly Windows 8 but I can't confirm that).

Feature request

stage 1. to recognise archives compressed (or bundled without compression) using LHA and set the automatic action to "extract" rather than "compress". Until full support this could result in a suitable error message which in my opinion is preferable to compressing the archive again to a different format.

stage 2. to support extraction of files from LHA archives (Mac users may need to compress as well if sharing with Windows users who want that format but I think that need is far less than extraction)

File format

File extension usually .lzh or .lha

First 21 bytes of the file header are of a standard format. For stage 2 of the request looking at the first 21 bytes has to be the first step because the single byte at offset 20 gives the "level" used and the elements of the header which follow differ according to the level.

The 5 bytes starting at offset 2 may be enough to identify the file as an archive of this type (in conjunction with the extension). This is the compression method id and is of the format :
where the first ? will be either "l" or "z" and the second "?" can possibly be any alphanumeric character. I've only seen digits but I know that "d" is used when there is no compression.

Attached is a description of the first 21 bytes of the header.

I can provide links to samples (if/when you're ready for them) or links to more detailed information.

Attachments (1)

lha.xml (762 bytes) - added by Lotusbrod 4 years ago.
LHA header format - first 21 bytes

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by Lotusbrod

Attachment: lha.xml added

LHA header format - first 21 bytes

comment:1 Changed 4 years ago by aONe

Some example files will help for sure :)

comment:2 Changed 4 years ago by Lotusbrod

Here are a few links to download samples. None of these URLs are designed to be accessed directly and whilst some are simply linked to from another page, a couple are only in scripts and will probably give an error in the browser but the files will be successfully downloaded. I've written them like this to avoid complicated explanations of which link to click on crowded Japanese sites.
Post office
Kanagawa prefectural government
Ministry of economy, trade and industry
Online software vendor (font) - despite the "ftp" in the server name, this URL only seems to work using http
Private individual (font)
Private individual (font)

comment:3 Changed 4 years ago by aONe

I've tryed them dropping to the extraction zone and where uncompressed without any hassle. So just adding lha to the extraction list (and obviously adding an icon) will do.

Anyway those files have the Asian language problem in the codification, wich is not that easy to fix.

Last edited 3 years ago by aONe (previous) (diff)

comment:4 Changed 4 years ago by Lotusbrod

Ah, yes.

I only tried it once and must have been testing with a corrupt file. Anyway, it is good new that it's a straightforward addition.

As for the character encoding problem, that is only to be expected when working with files created under Windows and is clearly a separate issue.

comment:5 Changed 4 years ago by aONe

Milestone: Keka 1.0.4
Owner: set to aONe
Status: newaccepted

Adding extensions to the supported list for the next release.

comment:6 Changed 4 years ago by aONe

Description: modified (diff)

comment:7 Changed 4 years ago by aONe

Milestone: Keka 1.0.4Keka 1.0.5

comment:8 Changed 3 years ago by aONe

Resolution: fixed
Status: acceptedclosed

Added to the extraction list. Still need and icon for it.

I hope Pablo can do the icons before the release :)

Last edited 3 years ago by aONe (previous) (diff)
Note: See TracTickets for help on using tickets.