How to dump json with single quote. #402
-
Thank you so much for the great library. I want to dump json with single quote like can you please explain how to do it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You'd have to modify In the And in the |
Beta Was this translation helpful? Give feedback.
-
when a string has ' how to replace it with \' ? |
Beta Was this translation helpful? Give feedback.
You'd have to modify
include/jsonencoder.hpp
to achieve that, making changes in two classes:basic_json_encoder
andbasic_compact_json_encoder
.In the
visit_key
function, remove the two occurrences ofsink_.push_back('\"')
;And in the
visit_string
function, change the two occurrences ofsink_.push_back('\"')
tosink_.push_back('\'')