From acb3150dd7d524bc52a04b90d80f1bc6eac4c5f9 Mon Sep 17 00:00:00 2001 From: fprintf Date: Tue, 28 Mar 2017 10:37:52 -0700 Subject: [PATCH] Fix - Add quoting of carriage return and remove quoting of single quotes/apostrophes Single quotes are not supposed to be escaped in compliant JSON and carriage return's should be escaped --- json4lua/json/json.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json4lua/json/json.lua b/json4lua/json/json.lua index d95241a..a2e2e17 100755 --- a/json4lua/json/json.lua +++ b/json4lua/json/json.lua @@ -332,7 +332,7 @@ end function encodeString(s) s = string.gsub(s,'\\','\\\\') s = string.gsub(s,'"','\\"') - s = string.gsub(s,"'","\\'") + s = string.gsub(s,'\r','\\r') s = string.gsub(s,'\n','\\n') s = string.gsub(s,'\t','\\t') return s