summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLloyd Hilaiel <lloyd@hilaiel.com>2011-04-25 16:19:17 -0600
committerLloyd Hilaiel <lloyd@hilaiel.com>2011-04-25 16:19:17 -0600
commitcc61a3f8acf44b0e2e50474f6cc595887611f379 (patch)
tree5d8e74dbe97f62b6a28f89a43970e4cbdb734318
parentbb396891e9f43570b892804b9d7da3f6dd823fc3 (diff)
downloadyajl-cc61a3f8acf44b0e2e50474f6cc595887611f379.tar.gz
add a comment to code regarding the forward solidus and the fact that escaping it is optional
-rw-r--r--src/yajl_encode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/yajl_encode.c b/src/yajl_encode.c
index a0ab8d1..981df5b 100644
--- a/src/yajl_encode.c
+++ b/src/yajl_encode.c
@@ -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;