Re: Is XPI JAR or ZIP?

Stanimir Stamenkov <[email protected]> Sun, 31 Aug 2008 11:37:26 +0300
Newsgroups gmane.comp.mozilla.devel.xpinstall
Message-ID <[email protected]>
Fri, 29 Aug 2008 11:25:28 +0200, /Georg Maa=DF/:
> Stanimir Stamenkov wrote:
>
>> How are (should be) file names inside XPI package encoded, are they =

>> encoded strictly using UTF-8 like in JAR archives, or using no =

>> specific (but US-ASCII base) encoding as with ZIP files?
> =

[...]
> So a good software design knows about all of this and therefore does not =

> use any characteres outside ASCII and also does not use anny assumptions =

> about case sensitivity to prevent unexpected trouble in an unknown =

> world, because real world is allways an unknown world.

My question was not about the issues when extracting the files to a =

file system but how to interpret/decode the file names when read =

directly from the archive.  As far as I know the JAR specification =

makes that additional specification path names inside JAR archives =

are UTF-8 encoded, because Java identifiers (class names) are =

Unicode, the least.  This way the path names inside the archive are =

really platform independent.  So my question still remains, is XPI =

based on the JAR specification, or just on the original ZIP =

specification where path names have no encoding specified therefore =

only ASCII is assumed safe?

As far as I'm aware *nix file systems have no file name encoding, =

also, and it's up to the software reading it to decode it properly. =

  I've seen the graphical file managers like Gnome always =

encode/decode file names using UTF-8, but then when listed in a =

console and the default console encoding is ISO-8859-1 the file =

names look garbled.  The same garbled result I get when listing the =

files from within Java, given the default console encoding is not UTF-8.

-- =

Stanimir