Closed volkaris closed 1 year ago
Cant parse string or const char*
setlocale(LC_ALL, "Rus"); using json = nlohmann::json;
auto q = R"("AUD": { "ID": "R01010", "NumCode": "036", "CharCode": "AUD", "Nominal": 1, "Name": "Австралийский доллар", "Value": 49.6231, "Previous": 49.3551 })"; string str1 = q; size_t start_pos = str1.find("Австралийский доллар"); str1.replace(start_pos, strlen("Австралийский доллар"), "aus"); q = str1.c_str(); cout << q; auto j = json::parse(q);
Error!!
No response
windows
latest
develop
You did not provide the exception message. I bet it has to do with encoding. The library only supports UTF-8. See https://json.nlohmann.me/home/faq/#parse-errors-reading-non-ascii-characters
Description
Cant parse string or const char*
Reproduction steps
setlocale(LC_ALL, "Rus"); using json = nlohmann::json;
Expected vs. actual results
Error!!
Minimal code example
No response
Error messages
No response
Compiler and operating system
windows
Library version
latest
Validation
develop
branch is used.