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

Problems with special German letters #1789

Closed
KeksMeister opened this issue Oct 14, 2019 · 2 comments
Closed

Problems with special German letters #1789

KeksMeister opened this issue Oct 14, 2019 · 2 comments
Labels
kind: question state: needs more info the author of the issue needs to provide more details

Comments

@KeksMeister
Copy link

KeksMeister commented Oct 14, 2019

Hi,

I have some problems with reading letters like Ä, Ü, Ö,... from a JSON file.
In my JSON file there is (besides a lot of other data):

{ "Szene_3": [ { [...] "Header": { [...] "Text": "Bücher" } } ] }

When I read this (jsonFile being of type json and i being an int)

std::ifstream inStream("config.json");
nlohmann::json jsonFile;
inStream >> jsonFile;
[...]
for (int i = 0; i < size; i++) {
    std::string header = jsonFile["Szene_3"][i]["Header"]["Text"];
    [...]
}

I get "Bücher" in the string. When I write this exact string back into my json File it becomes "Bücher" again, yet I need to display the correct string in my application.

Can please somebody help me with this?

@nlohmann
Copy link
Owner

In order to asses your issue, we need the following information:

  • What is the issue you have?

  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?

  • What is the expected behavior?

  • And what is the actual behavior instead?

  • Which compiler and operating system are you using? Is it a supported compiler?

  • Did you use a released version of the library or the version from the develop branch?

  • If you experience a compilation error: can you compile and run the unit tests?

@nlohmann nlohmann added the state: needs more info the author of the issue needs to provide more details label Oct 15, 2019
@nlohmann
Copy link
Owner

(Just a note: the library only supports UTF-8.)

@nlohmann nlohmann closed this as completed Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question state: needs more info the author of the issue needs to provide more details
Projects
None yet
Development

No branches or pull requests

2 participants