Rails provides an excellent XML Builder by default to build RSS and ATOM feeds, but nothing to help you build complex and custom JSON data structures. JSON Builder is here to help.
There are a bunch of control characters which users routinely enter such as "\v", "\f", "\u0003" and even "\b" which json_builder fails to escape resulting in an invalid output that both JSON.parse and browsers' JSON library choke on.
There are a bunch of control characters which users routinely enter such as
"\v"
,"\f"
,"\u0003"
and even"\b"
whichjson_builder
fails to escape resulting in an invalid output that bothJSON.parse
and browsers' JSON library choke on.Right now our only workaround is to sanitize user input.