add a comment to code regarding the forward solidus and the fact that escaping it is optional

This commit is contained in:
Lloyd Hilaiel 2011-04-25 16:19:17 -06:00
parent bb396891e9
commit cc61a3f8ac
1 changed files with 5 additions and 0 deletions

View File

@ -53,6 +53,11 @@ yajl_string_encode2(const yajl_print_t print,
case '\r': escaped = "\\r"; break;
case '\n': escaped = "\\n"; break;
case '\\': escaped = "\\\\"; break;
/* it is not required to escape a solidus in JSON:
* read sec. 2.5: http://www.ietf.org/rfc/rfc4627.txt
* specifically, this production from the grammar:
* unescaped = %x20-21 / %x23-5B / %x5D-10FFFF
*/
/* case '/': escaped = "\\/"; break; */
case '"': escaped = "\\\""; break;
case '\f': escaped = "\\f"; break;