Re: Is XPI JAR or ZIP?

Georg Maaß <[email protected]> Fri, 29 Aug 2008 11:25:28 +0200
Newsgroups gmane.comp.mozilla.devel.xpinstall
Message-ID <[email protected]>
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?
> 

Using ZipWiter component should make it as you need. The path strings 
are UNIX like. As long as you do not extract the XPI to the file system 
you do not need to bother about that. If you extract parts to the file 
system the path of the extracted stuff should be ASCII and not make any 
assumptions about case sensitivy because the target file system may have 
mixed case sensitivity within a path.

Sample:
-------
The boot filesytem on my Mac is non case sensitive as this is the 
default. But all external volumens are confugured to use the case 
sensitive journaled HFS+ file system. So if I mount such a volume to my 
Mac the path parts above the mount point are none case sensitive, but 
the path parts below the mount point are case sensitive.

So be aware of such mixed situations were some parts of the path are 
case sensitove and othere are not and also the differen parts of the 
path may support different character encodings, because a mounted NFS 
volume may belong to operating system, that has ISO-8859-1 as character 
encoding of the file system and not UTF-8. Also this is the case in my 
world, where old Linux machines use ISO-8859-1.

So real world is much more complex and less predictable than developers 
desktop.

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. Good design known 
that real worlds is unknown and kann not be completely investigated to 
become a really known world.