Closed
Description
Describe the bug
The tab character is not escaped on Windows with various locales. This bug is a regression in 1.9.3, it is not present in 1.9.2.
To Reproduce
Steps to reproduce the behavior:
setlocale(LC_ALL, "English_United States.1252");
Json::Value result(Json::objectValue);
result["test"] = "\tTest123";
Json::StreamWriterBuilder builder;
assert(Json::writeString(builder, result) == "{\"test\":\"\\tTest123\"}" );
Expected behavior
The tab character should be escaped.
Desktop:
- OS: Windows 10 1909
- Meson version - Using Conan
- Ninja version - Using Conan
Additional context
isAnyCharRequiredQuoting()
uses std::isprint()
which gives different results on Windows. The version of that function in 1.9.2 was working properly. Perhaps you can just revert it?
Update: It seems that the locale does not matter, to reproduce the bug you only need to have \t as a special character among the normal string.
Update 2: It seems that the locale does matter. Had to restart the PC to get proper results after changing the locale several times.
Metadata
Metadata
Assignees
Labels
No labels