Difference between revisions of "ZIM file format"

Jump to navigation Jump to search
320 bytes added ,  21:42, 5 August 2012
→‎URLs: absolude URLs are forbiden
(→‎URLs: absolude URLs are forbiden)
Line 223: Line 223:


== URLs ==
== URLs ==
ZIM contents are addressed using URLs: /<namespace>/<article_url>.


The references in Article Text (''<a href=""></a>'', ''<img src="">'' etc.) are URL-encoded ([http://www.ietf.org/rfc/rfc1738.txt RFC 1738]).
ZIM contents are addressed using URLs fitting the following pattern: <namespace>/<article_url>. The references in articles HTML code (''<a href=""></a>'', ''<img src="">'', etc.) are URL-encoded following the [http://www.ietf.org/rfc/rfc1738.txt RFC 1738] rules.
 
Absolute URLs, ie. with a leading slash (''/'') are forbidden, becaus this avoid including the ZIM content in any HTTP sub-hierachty. ZIM contents URLs must consequently be relative. Be careful, <article_url> may itself contain slashes (for example "BMW_501/502").


The URLs in the UrlPointerlist are not encoded. Some readers process the requests that already do the decoding internally whereas most readers will handle the URLs directly. In this case you have to do the decoding before you pass the parameter to zimlib, but zimlib already provides a method to do so.
The URLs in the UrlPointerlist are not encoded. Some readers process the requests that already do the decoding internally whereas most readers will handle the URLs directly. In this case you have to do the decoding before you pass the parameter to zimlib, but zimlib already provides a method to do so.

Navigation menu