Skip to content

avoid isprint, because it is locale specific #1189

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

Merged
merged 2 commits into from
Jun 11, 2020

Conversation

BillyDonahue
Copy link
Contributor

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

`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
@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.801% when pulling b395975 on BillyDonahue-avoid-isprint into 9be5895 on master.

@BillyDonahue BillyDonahue requested a review from baylesj June 10, 2020 22:15
@TheStormN
Copy link
Contributor

Btw, how about some unit tests(for Windows only) just to make sure this does not happen again?

@BillyDonahue
Copy link
Contributor Author

Good idea. I don't have a Windows dev setup though.
You came up with a good repro in the issue description, can you contribute that in unit test form? I can merge it into this PR.

@TheStormN
Copy link
Contributor

Good idea. I don't have a Windows dev setup though.
You came up with a good repro in the issue description, can you contribute that in unit test form? I can merge it into this PR.

Here you are: #1190 :)

@TheStormN
Copy link
Contributor

TheStormN commented Jun 11, 2020

@BillyDonahue You forgot to merge my PR into yours... I was specifically targeting at your PR for merging. Should I retarget to the master branch now?

@BillyDonahue
Copy link
Contributor Author

My PR is the same as master right now, so it should be the same thing.
I decided it was easier to just do two PRs in sequence. I'll merge yours as soon as CI is through with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: isAnyCharRequiredQuoting() is broken on Windows in JsonCpp 1.9.3 for some locales.
3 participants