1
0
mirror of https://github.com/nlohmann/json.git synced 2026-07-30 07:33:01 +04:00

Quick and dirty implementation for basic multilingual plane in the unicode escape mechanism

This commit is contained in:
Raphael Isemann
2015-01-10 10:36:30 +01:00
parent 13efc7a02a
commit 222aacc213
3 changed files with 81 additions and 0 deletions
+4
View File
@@ -1652,6 +1652,10 @@ TEST_CASE("Parser")
CHECK(json::parse("\"a\\nz\"") == json("a\nz"));
CHECK(json::parse("\"\\n\"") == json("\n"));
// escape unicode characters
CHECK(json::parse("\"\\u002F\"") == json("/"));
CHECK(json::parse("\"\\u00E4\"") == json(u8"\u00E4"));
// escaping senseless stuff
CHECK_THROWS_AS(json::parse("\"\\z\""), std::invalid_argument);
CHECK_THROWS_AS(json::parse("\"\\ \""), std::invalid_argument);