We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 66323d4 commit b2dee98Copy full SHA for b2dee98
1 file changed
autoload/webapi/json.vim
@@ -106,6 +106,7 @@ function! webapi#json#encode(val)
106
return a:val
107
elseif type(a:val) == 1
108
let json = '"' . escape(a:val, '\"') . '"'
109
+ let json = substitute(json, '\([[:cntrl:]]\)', '\=printf("\x%02d", char2nr(submatch(1)))', 'g')
110
let json = substitute(json, "\r", '\\r', 'g')
111
let json = substitute(json, "\n", '\\n', 'g')
112
let json = substitute(json, "\t", '\\t', 'g')
0 commit comments