Skip to content

Commit

Permalink
Merge 222ba38 into 3beb37e
Browse files Browse the repository at this point in the history
  • Loading branch information
dota17 committed Mar 19, 2020
2 parents 3beb37e + 222ba38 commit dfca28f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib_json/json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,11 @@ bool parseFromStream(CharReader::Factory const& fact, IStream& sin, Value* root,
char const* begin = doc.data();
char const* end = begin + doc.size();
// Note that we do not actually need a null-terminator.
// ignore BOM as suggested by RFC
if (strlen(begin) >= 3 && begin[0] == '\xEF' && begin[1] == '\xBB' &&
begin[2] == '\xBF') {
begin = begin + 3;
}
CharReaderPtr const reader(fact.newCharReader());
return reader->parse(begin, end, root, errs);
}
Expand Down

0 comments on commit dfca28f

Please sign in to comment.