1

I'm making a Json object like this :

Poco::JSON::Object obj;
obj.set("EncryptedKeyString", encryptedKey);
obj.set("EncryptedIVString", encryptedIV);
obj.set("EncryptedString", str_encrypted_base64);
obj.set("SignedDataString", signature);

and then stringifying it like this:

std::stringstream ss8;
obj.stringify(ss8);
std::ostream& o = session.sendRequest(req);
std::cout << ss8.str() << std::endl;

the result is this when printing

"EncryptedKeyString":"EWakRvh\/hY2oQ2Jburma\/jRzwrh

I don't understand why it's making these \, it is supposed to be like this :

"EncryptedKeyString":"EWakRvh/hY2oQ2Jburma/jRzwrh

Does anyone know how to fix this?

1 Answers1

0

RFC4627, 2.5. Strings:

Any character may be escaped.

...

char = unescaped /
                escape (
                    %x22 /          ; "    quotation mark  U+0022
                    %x5C /          ; \    reverse solidus U+005C
                    %x2F /          ; /    solidus         U+002F
                    %x62 /          ; b    backspace       U+0008
                    %x66 /          ; f    form feed       U+000C
                    %x6E /          ; n    line feed       U+000A
                    %x72 /          ; r    carriage return U+000D
                    %x74 /          ; t    tab             U+0009
                    %x75 4HEXDIG )  ; uXXXX                U+XXXX

See also this answer.

Alex
  • 5,159
  • 4
  • 25
  • 33