-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Why are all the results wrapped with "" #619
Comments
Because data's type is string, when it's key and value's type is also string, then we should enclose it with quotes. like this: so if you printf |
I am afraid I dont think that's the case, such the example: |
the resulting print |
What |
Yes, this absolutely print
At first, you can't pass
so let's parse the date:
let's explain the demo with public void test() {
String json = "\"2021-10-18\""; // if json = "2021-10-18", then parse will fail
Object obj = JSON.parse(json);
System.out.println(obj);
String str = JSON.toJSONString(obj); // equivalent to cJSON_Print in cJSON
System.out.println(str); // "2021-10-18", the same with cJSON
} |
char* data = cJSON_Print(value); printf(data)
The print result is
"2021-10-18"
What i expect is
2021-10-18
The text was updated successfully, but these errors were encountered: