Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix - Add quoting of carriage return and remove quoting of single quo…
…tes/apostrophes

Single quotes are not supposed to be escaped in compliant JSON and carriage return's should be escaped
  • Loading branch information
fprintf
fprintf committed Mar 28, 2017
commit acb3150dd7d524bc52a04b90d80f1bc6eac4c5f9
2 changes: 1 addition & 1 deletion json4lua/json/json.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down