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

Has this lib the unicode (wstring) support? #722

Closed
bajimu opened this issue Sep 1, 2017 · 5 comments
Closed

Has this lib the unicode (wstring) support? #722

bajimu opened this issue Sep 1, 2017 · 5 comments

Comments

@bajimu
Copy link

bajimu commented Sep 1, 2017

Has this lib the unicode (wstring) support?

@nlohmann
Copy link
Owner

nlohmann commented Sep 1, 2017

Yes, the library supports UTF-8. No, it can not parse input from std::wstring.

@bajimu
Copy link
Author

bajimu commented Sep 1, 2017

@nlohmann, so how i can get unicode string from json ? String support Ascii ony.

@nlohmann
Copy link
Owner

nlohmann commented Sep 1, 2017

std::string is agnostic to the encoding of the bytes it stores, and we assume UTF-8. You can use it as follows:

std::string s = "[\"öäüß😃\"]";
std::json j = json::parse(s);

@nlohmann
Copy link
Owner

nlohmann commented Sep 2, 2017

Do you need further assistance?

@nlohmann
Copy link
Owner

nlohmann commented Aug 1, 2021

I added an FAQ entry: https://json.nlohmann.me/home/faq/#wide-string-handling

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

No branches or pull requests

2 participants