akheron/jansson — pull request #68 by japeq (2012-04-15 18:44:32+00:00)
Title: Add support for loading bencoded data

Adds support for loading bencode data. Bencode is very similar to JSON,
but is a bit more compact presentation and supports arbitary binary strings.
Like JSON, bencode can be used to store any recursive data structure made
of basic types. Bencode was first introduced by BitTorrent, and is based on
Python types.

The official bencode specifies lists, dictionaries, integers and strings.
Unlike JSON, because bencode does not specify any encoding (i.e. UTF-8),
applications dicatate the encoding for the strings. Strings are passed
unmodified to the caller with one caveat: Because jansson uses C strings,
null bytes are not allowed. Lists are decoded as JSON arrays and
dictionaries, which are key-values pairs with strings used for keys, as
JSON objects.