diff --git a/include/chaiscript/utility/json.hpp b/include/chaiscript/utility/json.hpp index d7c632c6..c6988d54 100644 --- a/include/chaiscript/utility/json.hpp +++ b/include/chaiscript/utility/json.hpp @@ -392,7 +392,7 @@ class JSON bool skip = true; for( auto &p : *internal.Map ) { if( !skip ) { s += ",\n"; } - s += ( pad + "\"" + p.first + "\" : " + p.second.dump( depth + 1, tab ) ); + s += ( pad + "\"" + json_escape(p.first) + "\" : " + p.second.dump( depth + 1, tab ) ); skip = false; } s += ( "\n" + pad.erase( 0, 2 ) + "}" ) ;