renenglish/pb2json — pull request #2 by ms705 (2013-03-22 11:51:07+00:00)
Title: Support encoding of binary "bytes" fields

protobufs internally treat these fields as strings, but jansson hickups on trying to convert arbitrary binary into a string, and silently discards the field.

This patch adds a simple wrapper that hex-encodes the that if the field is of TYPE_BYTES. This way, the JSON is printable, and binary bytes fields can be preserved (although they will have to be re-encoded if ever put back into a protobuf).