Skip to content
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

dump() can't handle umlauts #1131

Closed
a-ma72 opened this issue Jun 15, 2018 · 5 comments
Closed

dump() can't handle umlauts #1131

a-ma72 opened this issue Jun 15, 2018 · 5 comments

Comments

@a-ma72
Copy link

a-ma72 commented Jun 15, 2018

This small example runs into an exception ("invalid UTF-8 byte at index..."):

    nlohmann::json test;
    test["Value"] = "Für";
    cout << test.dump().c_str();
@nlohmann
Copy link
Owner

The library supports UTF-8. Please make sure your compiler is correctly configured.

@a-ma72
Copy link
Author

a-ma72 commented Jun 15, 2018

You don't get an exception with my code example?
What exactly do I have to check?

@nlohmann
Copy link
Owner

Which compiler do you use? Is the source file UTF8-encoded?

@a-ma72
Copy link
Author

a-ma72 commented Jun 15, 2018

Ah, ok. I have to do the latin to utf8 conversion by myself. The native ASCII string is the problem.

@a-ma72 a-ma72 closed this as completed Jun 15, 2018
@nlohmann
Copy link
Owner

No, the library only supports Unicode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants