json generator: fix escape chars as per json spec, which is a subset of c/c++

This commit is contained in:
Dane Springmeyer 2012-08-25 11:24:45 -07:00
parent 52c180aebc
commit fa0678cc5a

View file

@ -148,9 +148,14 @@ struct escaped_string
using boost::spirit::karma::maxwidth;
using boost::spirit::karma::right_align;
esc_char.add('\a', "\\a")('\b', "\\b")('\f', "\\f")('\n', "\\n")
('\r', "\\r")('\t', "\\t")('\v', "\\v")('\\', "\\\\")
('\'', "\\\'")('\"', "\\\"")
esc_char.add
('"', "\\\"")
('\\', "\\\\")
('\b', "\\b")
('\f', "\\f")
('\n', "\\n")
('\r', "\\r")
('\t', "\\t")
;
esc_str = karma::lit(karma::_r1)