Skip to content

Commit 3385b6b

Browse files
committed
Make string to double conversion locale invariant.
Applying Stephen Wagner's fix from this commit to JsonCpp 1.9.5: c36b636
1 parent fc6ce76 commit 3385b6b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lib_json/json_reader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ bool Reader::decodeDouble(Token& token, Value& decoded) {
601601
double value = 0;
602602
String buffer(token.start_, token.end_);
603603
IStringStream is(buffer);
604+
is.imbue( std::locale::classic() );
604605
if (!(is >> value)) {
605606
if (value == std::numeric_limits<double>::max())
606607
value = std::numeric_limits<double>::infinity();

0 commit comments

Comments
 (0)