parse_options::allow_invalid_utf16

Non-standard extension option.

Synopsis

bool allow_invalid_utf16 = false;

Description

Allow invalid UTF-16 surrogate pairs to appear in strings. When enabled, the parser will not strictly validate the correctness of UTF-16 encoding, allowing for the presence of illegal leading or trailing surrogates. In case of invalid sequences, the parser will replace them with the Unicode replacement character (U+FFFD).

Enabling this option may result in the parsing of invalid UTF-16 sequences without error, potentially leading to the loss of information.