fixed: using size() when serializing strings - this allows to serialize a string which contain a null character

fixed: printing null character in space format: \u0000 (before was \0 which is not correct in json)
fixed: in serialize_string_buffer(const char * input_str, ...) a temporary fixed was used when copying input string
added support for surrogate pairs when reading \uHHHH format
added support to parse \u{H...} format (only if parsing Space format)
This commit is contained in:
2021-06-14 13:48:32 +02:00
parent 49c2b478c0
commit 4d70ae9e87
9 changed files with 262 additions and 39 deletions

View File

@@ -953,7 +953,7 @@ std::string Space::to_str() const
if( type == type_wstring )
{
TextStream stream;
serialize_string_buffer(value.value_wstring.c_str(), stream, Escape::no_escape);
serialize_string_buffer(value.value_wstring.c_str(), value.value_wstring.size(), stream, Escape::no_escape);
stream.to_string(str);
return str;
}