From 7befa3e83bd60f1b749d80420ee5189d095f4682 Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Sat, 7 May 2011 00:22:31 +0930 Subject: Escape forward slash when encoding Escaping forward slash can be useful when including JSON output in HTML (Eg, embedded in SCRIPT tags). --- lua_cjson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua_cjson.c b/lua_cjson.c index c4c5a96..8727364 100644 --- a/lua_cjson.c +++ b/lua_cjson.c @@ -123,7 +123,7 @@ static const char *char2escape[256] = { "\\u0018", "\\u0019", "\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f", NULL, NULL, "\\\"", NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, "\\/", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -- cgit v1.2.3-55-g6feb