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

Wide character strings not supported #216

Closed
kalumekenge opened this issue Feb 29, 2016 · 2 comments
Closed

Wide character strings not supported #216

kalumekenge opened this issue Feb 29, 2016 · 2 comments
Labels
confirmed solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope)

Comments

@kalumekenge
Copy link

    std::wstring s1 = LR"({
  "pi": 3.141,
  "happy": true,
  "name": "Niels",
  "nothing": null,
  "answer": {
    "everything": 42
  },
  "list": [1, 0, 2],
  "object": {
    "currency": "USD",
    "value": 42.99
  }
})";
auto p0 = json::parse(s1);
auto p1 = p0.dump();
std::wcout << p1 << std::endl;

VS 2015 Community Edition
error C2665: 'nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator::parse': none of the 3 overloads could convert all the argument types
while trying to match the argument list '(std::wstring)'

@nlohmann
Copy link
Owner

@kalumekenge, I made a branch to fix this version. Unfortunately, it requires the <codecvt> header which is not included in many Clang and GCCs out there.

@nlohmann nlohmann added the solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope) label Apr 10, 2016
@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
Labels
confirmed solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope)
Projects
None yet
Development

No branches or pull requests

2 participants