mirror of
https://github.com/nlohmann/json.git
synced 2025-07-28 12:02:00 +03:00
Merge pull request #1446 from scinart/develop
attempt to fix #1445, flush buffer in serializer::dump_escaped in UTF8_REJECT case.
This commit is contained in:
@ -11344,6 +11344,16 @@ class serializer
|
||||
string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBF');
|
||||
string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBD');
|
||||
}
|
||||
|
||||
// write buffer and reset index; there must be 13 bytes
|
||||
// left, as this is the maximal number of bytes to be
|
||||
// written ("\uxxxx\uxxxx\0") for one code point
|
||||
if (string_buffer.size() - bytes < 13)
|
||||
{
|
||||
o->write_characters(string_buffer.data(), bytes);
|
||||
bytes = 0;
|
||||
}
|
||||
|
||||
bytes_after_last_accept = bytes;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user