| 1 | <section> <date> 2004 </date> |
| 2 | <H2> FAQ </H2> (non)frequently asked questions |
| 3 | |
| 4 | <BLOCKQUOTE> |
| 5 | While using the zziplib some people come up with questions and |
| 6 | problems that need a little longer to be explained. So here is |
| 7 | a list of these notes for your information. Keep it up. |
| 8 | </BLOCKQUOTE> |
| 9 | <ul> |
| 10 | <li> <a href="#latin-1">extended ascii characters in names of zipped files </a> |
| 11 | </li> |
| 12 | <li> <a href="#utf-8">unicode support for names of zipped files </a> |
| 13 | </li> |
| 14 | <li> <a href="#timestamps">timestamps of zipped files </a> |
| 15 | </li> |
| 16 | <li> <a href="#install">installation instructions </a> |
| 17 | </li> |
| 18 | <li> <a href="#php">php zip module installation </a> |
| 19 | </li> |
| 20 | <li> <a href="#license">commercial support </a> |
| 21 | </li> |
| 22 | </ul> |
| 23 | |
| 24 | <DL> |
| 25 | <DT><a name="latin-1" /> |
| 26 | zziplib does not support extended ascii characaters, winzip does</DT> |
| 27 | <DD><P> |
| 28 | That's somehow incorrect - the ascii range is the 7bit lower plane of |
| 29 | an 8bit character encoding. The upper plane had been non-standard for |
| 30 | decades including the age when the ZIP file format was invented. The |
| 31 | first instances of pkware's zip compressor were used on DOS with a |
| 32 | codepage 437 which has a way different encoding for the upper plane |
| 33 | than today's latin-1 encoding which in fact used in <em>all</em> |
| 34 | modern operating systems. So what really see is a mismatch of |
| 35 | character encodings that you are used to. |
| 36 | </P><P> |
| 37 | Even more than that the character encoding had never been specified |
| 38 | at all for the filenames in the central directory part. An alert |
| 39 | reader will however recognize that <em>each</em> file entry does |
| 40 | also have version-info field telling about the compressor that did |
| 41 | create the file entry. That version-info has an upper byte telling |
| 42 | about the host OS being in use while packaging. A heavy-weight |
| 43 | zip decoder might use that value to infer the character encoding |
| 44 | on the host OS (while compressing), to detect a mismatch to the |
| 45 | current OS (while decompressing), and going to re-code the filename |
| 46 | accordingly. |
| 47 | </P><P> |
| 48 | Even more than that the zip file format has seen various extensions |
| 49 | over time that have found their place in an extra info block. There |
| 50 | are info blocks telling more about the filename / codeset. However |
| 51 | the zziplib library does not even attempt to decode a single extra |
| 52 | info block as zziplib is originally meant to be a light-weight library. |
| 53 | However one might want to put a layer on top of the structure decoding |
| 54 | of zziplib that does the necessary detection of character encodings and |
| 55 | re-coding of name entries. Such a layer has not been written so far. |
| 56 | </P></DD> |
| 57 | <DT><a name="utf-8" /> |
| 58 | zziplib does not support any unicode plane for filenames </DT> |
| 59 | <DD><P> |
| 60 | The pkware's appnote.text has an extra info block (id-8) for the |
| 61 | unicode name of the file entry but it was never actually being |
| 62 | used AFAICS. This might be related to the current developments of |
| 63 | older systems to drop usage of latin-1 encoding in the upper plane |
| 64 | of 8bit characters and instead choosing the multibyte encoding |
| 65 | according to UTF-8. This is again highly system specific. |
| 66 | </P><P> |
| 67 | Basically, you would need to instruct the compressor to use |
| 68 | UTF-8 encoding for the file-entries to arrive at a zip archive |
| 69 | with filenames in that specific character encoding. Along with |
| 70 | this zip archive one can switch the application into utf-8 usage |
| 71 | as well and take advantage of filename matches in that encoding. |
| 72 | This will make it so there is not mismatch in character encoding |
| 73 | and implicit re-coding being needed. |
| 74 | </P></DD> |
| 75 | <DT><a name="timestamps" /> |
| 76 | zziplib does not return stat values for file timestamps </DT> |
| 77 | <DD><P> |
| 78 | That's correct and again a re-coding problem. The original |
| 79 | timestamp in each file entry is in DOS format (i.e. old-FAT). |
| 80 | The stat value is usually expected to be in POSIX format. The |
| 81 | win32 API has an extra function for conversion but none of the |
| 82 | unix compatibles has one, so it would be needed to ship a |
| 83 | conversion function along with zziplib. |
| 84 | </P><P> |
| 85 | However the zziplib is intended to be light-weight system and |
| 86 | used largely for packaging data for an application. There it |
| 87 | is not used strictly as a variant of Virtual File System (vfs) |
| 88 | that would need to map any information from the zip file system |
| 89 | to native host system. Of course applications are free to cut |
| 90 | out the DOS file timestamp and re-code it on their own. It's |
| 91 | just that zziplib does not provide that re-coding originally. |
| 92 | </P></DD> |
| 93 | <DT><a name="install" /> |
| 94 | how can one install the zziplib package </DT> |
| 95 | <DD><P> |
| 96 | The zziplib project is opensource which effectly gives two ways of |
| 97 | installing the package: one can download the source archive and use |
| 98 | a C compiler to derive a binary executable for whatever computer |
| 99 | it needs to be on (see the platform compatibility list). This is |
| 100 | the preferred way but for convenience one can download a binary |
| 101 | installation archive with precompiled executables. |
| 102 | </P><P> |
| 103 | The current project uses autoconf/automake for cross platform |
| 104 | support which includes most unix compatible systems and their |
| 105 | native C compilers. The derivates of the GNU C compiler (gcc) have |
| 106 | replaced most of these native C compilers in the past years. The |
| 107 | <a href="http://www.mingw.org">mingw32</a> project has ported a |
| 108 | unix born C compiler to win32 and zziplib can be compiled with |
| 109 | it for the various win32 platforms. |
| 110 | </P><P> |
| 111 | There exist some C compilers which can not be embedded easily into |
| 112 | a unix compilation framework. The zziplib source archive ships with |
| 113 | project files for MSVC6 and MSVC6 (Microsoft Visual C). Adapting |
| 114 | these project files might help with installation problems of the |
| 115 | DLL hell on win32 platforms. There exist no sufficient guidelines to |
| 116 | mix binary helper libraries for many applications on windows. |
| 117 | </P><P> |
| 118 | There exists win32 binary archives as zip files on the download area |
| 119 | of zziplib (MSI is always on my wishlist). Including the project as |
| 120 | a helper library however you should not use it but instead compile |
| 121 | from source. The general library installation on unix are better, |
| 122 | the zziplib download area contains regularly some linux binary |
| 123 | archives (rpm). Many vendors of unix compatible systems provide |
| 124 | precompiled binary packages of zziplib on their own. |
| 125 | </P></DD> |
| 126 | <DT><a name="php" /> |
| 127 | after installing zziplib the php zip module still does not work </DT> |
| 128 | <DD><P> |
| 129 | Now that is one of <b>the most</b> frequently asked questions that |
| 130 | I do receive. There is just one major problem with it: I did not |
| 131 | write the php zip module (which uses zziplib) and I have no idea |
| 132 | how php modules work or how to tell apache's php sandbox to make |
| 133 | it work. Really, I do not have the slightest clue on that. |
| 134 | </P><P> |
| 135 | I was posting to some php developer sites to spread awareness of |
| 136 | the fact and hopefully to find a guy that I could forward any |
| 137 | questions on the php zip module installation. But so far there is |
| 138 | nothing, it merily seems that such installation problems are in no |
| 139 | way related to zziplib anyway but exists <b>with any other module with a |
| 140 | third party library dependency</b> as well. So the answers on php forum |
| 141 | sites will ask for details of the current php and apache configuration. |
| 142 | </P><P> |
| 143 | Since I do not run a php zip whatever nor any other php stuff, it's |
| 144 | just that those hints were not quite helpful to me. It would be really |
| 145 | really great if someone with a php zip background could be so nice to |
| 146 | write a short roundup of the areas to check when a php zip module |
| 147 | installation fails, so that I could post it here. Where are you? |
| 148 | Yours desperatly... ;-) |
| 149 | </P></DD> |
| 150 | <DT><a name="license" /> |
| 151 | how to obtain a license and support contract for a commercial project </DT> |
| 152 | <DD><P> |
| 153 | The zziplib has been created as a spare time project and it is put |
| 154 | under a very easy free public license. Even for commercial projects |
| 155 | there is hardly any need to negotiate a separate license since the |
| 156 | restrictions of the GNU LGPL or MPL can be matched easily. As a |
| 157 | general hint, if the zziplib is shipped unmodified with your project |
| 158 | then you are right within the limits of the free public license. |
| 159 | </P><P> |
| 160 | Sometimes the question for a personal license comes up for very |
| 161 | different reason - the need for a support contract and/or the setting |
| 162 | of functionality guarantees. The free public licenses include a safeguard |
| 163 | clause to that end, "in the hope that it will be useful, |
| 164 | but <em>without any warranty</em>; without even the implied warranty of |
| 165 | <em>merchantability</em> or <em>fitness for a particular purpose</em>." |
| 166 | Since the project was developed as a spare time project however there |
| 167 | have never been personal licenses going beyond. |
| 168 | </P><P> |
| 169 | In general you can still try to negotiate a support contract but it |
| 170 | will be very costly. It is much more profitable for you to tell one |
| 171 | of your developers to have a look at the source code and ensure the |
| 172 | required functionality is there, with hands on. The source code is |
| 173 | written to be very readable, maintainable and extensible. Just be |
| 174 | reminded that the free public licenses have restrictions on shipping |
| 175 | modified binaries but I can give you a cheap personal license to |
| 176 | escape these. (Such licenses can be obtained in return for tax-deductible |
| 177 | donations to organisations supporting opensource software). |
| 178 | </P></DD> |
| 179 | </DL> |
| 180 | |
| 181 | <P> and as always - <em> Patches are welcome </em> - </P> |
| 182 | </section> |