If by "special characters" you mean anything that's not an ASCII
"letter", then you may want to use the JSON_ENSURE_ASCII flag during
your encoding. By default Jansson will assume the generated JSON is to
be in UTF-8 encoding (e.g., Unicode), which means that there is no
reason to escape "special" characters.
See http://www.digip.org/jansson/doc/2.2/apiref.html#encoding
--
Deron Meranda
http://deron.meranda.us/
Glad you got it working. Yes, many JSON implementations in different
languages do different things. Some of them, like Jansson, embrace
Unicode and the UTF-8 encoding so only escape where absolutely
necessary; while other implementations try to keep everything as
ASCII-like as possible.
Be assured that Jansson has been rigorously tested against the JSON
spec. You can read the chapter in the docs about it's compliance and
any quirks (mostly imposed by the limits of the C language).
With regards to characters, really the only thing it can't handle
correctly is the zero-byte (technically Unicode character U+0000).
Also, all non-printable control characters (i.e., 0x00 through 0x1F),
not just \b \f \n \r \t, must be escaped.
The syntax diagrams on http://json.org/ are super simple and easy for
beginners to get a feel for JSON. But if you want all the nitty-gritty
details, then you have to go read the full spec, RFC 4627 at
http://tools.ietf.org/html/rfc4627.html
The Jansson conformance details are at
http://www.digip.org/jansson/doc/2.2/conformance.html
Of course, you still may want to force Jansson to output escapes using
the JSON_ENSURE_ASCII flag ... it really depends on what you're using
and if your other apps are prepared to deal with UTF-8, or just ASCII
(e.g., if you're hand-editing in a text editor, etc.) Jansson gives
you flexibility there.