1. Define any message with a bytes field.
2. Create an instance of that message with that field set to a value that
contains bytes 0x07 or 0x0b
3. Call JsonFormat.printToString. The generated JSON will contain a string
value for this field with the tokens \a and \v in this value. This is invalid
JSON according to the JSON spec (http://www.json.org/) because 'a' and 'v' are
not amongst the characters that are allowed to follow a reverse solidus. No
standards-compliant JSON parser (e.g. Jackson) or validator (e.g.
www.jsonlint.org) will parse this JSON.
These escapes are explicitly added by the method JsonFormat.escapeBytes(). It's
unclear why \a and \v need special handling rather than just being turned into
unicode characters.
Environment:
* JsonFormat 1.1 (though the head of the current source (r. 34) currently has
this issue as well)
* OS X 10.6.4
* Java:
** java version "1.6.0_20"
** Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065)
** Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)
* Jackson 1.5.4 (though any other standards-compliant parser will fail to parse
this as well, e.g. www.jsonlint.org)
Original issue reported on code.google.com by rosenblu...@gmail.com on 31 Jul 2010 at 7:22
Original issue reported on code.google.com by
rosenblu...@gmail.com
on 31 Jul 2010 at 7:22