-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2 backslash cause problem #2652
Comments
The literal |
To get your desired result, you need to escape twice, once for JSON and one for std::string.
or you can use a raw string literal and only escape once
|
@yazi1297 Do you need further assistance with this issue? |
use a raw string literal seems not work |
Code like this:
It will crash, and error log is
What is the issue you have?
When I analyze json code which have 2 backslash, my proejct will crash.
Please describe the steps to reproduce the issue.
Can you provide a small but working code example?
What is the expected behavior?
It should print {"file_path":"C:\123.txt"} on the screen
And what is the actual behavior instead?
It crashed.
Which compiler and operating system are you using?
Which version of the library did you use?
develop
branchdevelop + 3.9.1
If you experience a compilation error: can you compile and run the unit tests?
The text was updated successfully, but these errors were encountered: