decode_unicode_0.cpp 339 B

123456789101112
  1. #define ARDUINOJSON_DECODE_UNICODE 0
  2. #include <ArduinoJson.h>
  3. #include <catch.hpp>
  4. TEST_CASE("ARDUINOJSON_DECODE_UNICODE == 0") {
  5. DynamicJsonDocument doc(2048);
  6. DeserializationError err = deserializeJson(doc, "\"\\uD834\\uDD1E\"");
  7. REQUIRE(err == DeserializationError::Ok);
  8. REQUIRE(doc.as<std::string>() == "\\uD834\\uDD1E");
  9. }