-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
could not find to_json() method in T's namespace #1140
Comments
The error message indicates that you try to convert a type to JSON that the library does not know. In that case, it searches for a In your case, the problem seems to be line subscriber["Name"] = &callerName; What is the type of |
std::string pointer, I realized that I have been trying to access it by reference, that was causing the issue, cheers for pointing my attention to it! |
Cool! Does it work now? |
It does work now, but how should I deal with Unicode characters? Is it possible to use std::wstring ? I would really like to avoid having to get another library and trying to figure how to encode strings in utf-8 |
Nvm seems c++11 introduced easy way to encode strings to utf-8
Feel free to close this now! 👍 |
That still depends on the compiler encoding the source text properly however. |
Indeed the library only supports UTF-8, though you may parse from std::wstring (in the latest develop version). But @OvermindDL1 is right - your compiler must make sure that string literals are actually encoded with UTF-8. |
and
Both cause the error
Vs 2017, latest release
I seem to be unable to create json object, I've read through documentation like 20 times and there is nothing else that has been mentioned about it.
The text was updated successfully, but these errors were encountered: