ignore UTF-8 byte order mark (fixes #152)
This commit is contained in:
parent
e0d334c4f1
commit
9da8770f3a
4 changed files with 271 additions and 212 deletions
3
test/json_nlohmann_tests/bom.json
Normal file
3
test/json_nlohmann_tests/bom.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"foo": true
|
||||
}
|
|
@ -10022,6 +10022,14 @@ TEST_CASE("Unicode", "[hide]")
|
|||
// the array has 1112064 + 1 elemnts (a terminating "null" value)
|
||||
CHECK(j.size() == 1112065);
|
||||
}
|
||||
|
||||
SECTION("ignore byte-order-mark")
|
||||
{
|
||||
// read a file with a UTF-8 BOM
|
||||
std::ifstream f("test/json_nlohmann_tests/bom.json");
|
||||
json j;
|
||||
CHECK_NOTHROW(j << f);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("regression tests")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue