We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It was mentioned before that latest in dev version supports wstring parsing when creating json. How one would go about parsing wstring. Obvious way of
static int SendToAgent(std::wstring & data, LPCWSTR LogType) { if (mqttHandlerGlobal.IsAgentOnline()) { nlohmann::json messageJson = { { "DataType", u8"Test message" }, { "Data", data }, }; auto message = messageJson.dump(); return mqttHandlerGlobal.MqttSend(message, *mqttHandlerGlobal.GetTopic()); } return 0; }
Doesn't work as you end up with gibberish numbers in data field which then doesn't get parsed as json at the other end.
The text was updated successfully, but these errors were encountered:
The library can only parse from std::wstring. You try to construct from a std::wstring.
std::wstring
So json::parse(data) should work.
json::parse(data)
Sorry, something went wrong.
cheers, works wonders!
No branches or pull requests
It was mentioned before that latest in dev version supports wstring parsing when creating json.
How one would go about parsing wstring. Obvious way of
Doesn't work as you end up with gibberish numbers in data field which then doesn't get parsed as json at the other end.
The text was updated successfully, but these errors were encountered: