-
-
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
App crashes when dump method called for non ascii chars. #2126
Comments
What is the exact error message? |
Unhandled exception at 0x775A2552 in nlohmannsample.exe: Microsoft C++ exception: nlohmann::detail::type_error at memory location 0x010FEEA4. occurred. Attached is the sample app to try. It is a VS2019 solution |
Can you provide the what() string from the exception and a stack trace? |
Call Stack: This same thing can be reproduced with the attached sample source code. |
When I compile the code, I get the following warning:
At runtime, I get the following exception:
See https://github.com/nlohmann/json#character-encoding - this library only supports UTF-8 and will throw an exception when trying to serialize data that is not UTF-8 encoded. When I save the file as UTF-8, there is no compilation warning and the string "Casa De Los Niños, Inc." is correctly printed. |
Thanks a lot.. |
`#include "nlohmann\json.hpp"
#include
#include
using nlohmann::json;
int main()
{
std::string s = "Casa De Los Niños, Inc."; // Sample string with non ascii chars at 15th location 1 based index.
}
`
Project is setup with MBCS Character set.
The text was updated successfully, but these errors were encountered: