🚧 WIP for #4552

This commit is contained in:
Niels Lohmann
2024-12-18 09:47:23 +01:00
parent 30cd44df95
commit 4d67e127aa
4 changed files with 25 additions and 1 deletions

View File

@@ -995,6 +995,14 @@ TEST_CASE("regression tests 2")
CHECK(p.x == 1);
CHECK(p.y == 2);
}
SECTION("issue #4552 - UTF-8 invalid characters are not always ignored when dumping with error_handler_t::ignore")
{
nlohmann::json node;
node["test"] = "test\334\005";
const auto test_dump = node.dump(-1, ' ', false, nlohmann::json::error_handler_t::ignore);
CHECK(test_dump == "{\"test\":\"test\334\\u0005\"}");
}
}
DOCTEST_CLANG_SUPPRESS_WARNING_POP