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.hppto achieve that, making changes in two classes:basic_json_encoderandbasic_compact_json_encoder.In the
visit_keyfunction, remove the two occurrences ofsink_.push_back('\"');And in the
visit_stringfunction, change the two occurrences ofsink_.push_back('\"')tosink_.push_back('\'')