-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Regression: isAnyCharRequiredQuoting() is broken on Windows in JsonCpp 1.9.3 for some locales. #1187
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
Comments
Wait, are you saying |
@BillyDonahue Yeah, I had hard times debugging that, but it seems that it depends on the locale. For example So, basically it depends on the users system-wide locale if this will work or not. I've provided a easy to reproduce version with setting the locale by using C++ code. |
`std::isprint` is locale-specific and the JSON-spec is not. In particular, isprint('\t') is true in Windows CP1252. Has bitten others, e.g. laurikari/tre#64 Fixes #1187
* avoid isprint `std::isprint` is locale-specific and the JSON-spec is not. In particular, isprint('\t') is true in Windows CP1252. Has bitten others, e.g. laurikari/tre#64 Fixes #1187 * semicolon (rookie mistake!)
* avoid isprint `std::isprint` is locale-specific and the JSON-spec is not. In particular, isprint('\t') is true in Windows CP1252. Has bitten others, e.g. laurikari/tre#64 Fixes #1187 * semicolon (rookie mistake!) * Windows tab escape testing with custom locale (#1190) Co-authored-by: Nikolay Baklicharov <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
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:
Expected behavior
The tab character should be escaped.
Desktop:
Additional context
isAnyCharRequiredQuoting()
usesstd::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.
The text was updated successfully, but these errors were encountered: