mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-16 20:12:16 +02:00
deserializeJson() leaves \uXXXX instead of returning NotSupported
This commit is contained in:
@ -5,6 +5,7 @@ HEAD
|
|||||||
----
|
----
|
||||||
|
|
||||||
* Removed support for `char` values, see below (issue #1498)
|
* Removed support for `char` values, see below (issue #1498)
|
||||||
|
* `deserializeJson()` leaves `\uXXXX` unchanged instead of returning `NotSupported`
|
||||||
|
|
||||||
> ### BREAKING CHANGES
|
> ### BREAKING CHANGES
|
||||||
>
|
>
|
||||||
|
@ -7,5 +7,6 @@ TEST_CASE("ARDUINOJSON_DECODE_UNICODE == 0") {
|
|||||||
DynamicJsonDocument doc(2048);
|
DynamicJsonDocument doc(2048);
|
||||||
DeserializationError err = deserializeJson(doc, "\"\\uD834\\uDD1E\"");
|
DeserializationError err = deserializeJson(doc, "\"\\uD834\\uDD1E\"");
|
||||||
|
|
||||||
REQUIRE(err == DeserializationError::NotSupported);
|
REQUIRE(err == DeserializationError::Ok);
|
||||||
|
REQUIRE(doc.as<std::string>() == "\\uD834\\uDD1E");
|
||||||
}
|
}
|
||||||
|
@ -384,11 +384,10 @@ class JsonDeserializer {
|
|||||||
return false;
|
return false;
|
||||||
if (codepoint.append(codeunit))
|
if (codepoint.append(codeunit))
|
||||||
Utf8::encodeCodepoint(codepoint.value(), _stringStorage);
|
Utf8::encodeCodepoint(codepoint.value(), _stringStorage);
|
||||||
continue;
|
|
||||||
#else
|
#else
|
||||||
_error = DeserializationError::NotSupported;
|
_stringStorage.append('\\');
|
||||||
return false;
|
|
||||||
#endif
|
#endif
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// replace char
|
// replace char
|
||||||
|
Reference in New Issue
Block a user