diff --git a/sdk/core/azure-core/test/ut/json_test.cpp b/sdk/core/azure-core/test/ut/json_test.cpp index 059e899b1..449b8d0b8 100644 --- a/sdk/core/azure-core/test/ut/json_test.cpp +++ b/sdk/core/azure-core/test/ut/json_test.cpp @@ -17,6 +17,15 @@ TEST(Json, create) EXPECT_EQ(expected, j.dump()); } +TEST(Json, utf8BOM) +{ + // Verify that the UTF-8 BOM bytes (0xEF, 0xBB, 0xBF) are skipped when parsing JSON using the + // library. + std::array v{239, 187, 191, '5'}; + json jsonRoot = json::parse(v); + EXPECT_EQ(jsonRoot.get(), 5); +} + TEST(Json, duplicateName) { json jsonRoot = json::parse(R"({"KeyName": 1, "AnotherObject": {"KeyName": 2}})");