Set the allowUnescapedControlCharacters option to the specified value.
Declared in <bdljsn_tokenizer.h>
Tokenizer&
setAllowUnescapedControlCharacters(bool value);
If true, characters in the range [ 0x00 .. 0x1F ] are allowed in JSON strings. If the option is false, these characters must be represented by their six byte escape sequences [ u0000 .. u001F ]. Several values in that range are also (conveniently) represented by two byte sequences: ` " quotation mark reverse solidus / solidus backspace f form feed line feed r carriage return t tab ` The DEL control character (0x7F) is accepted even in strict mode.
The behavior is undefined unless e_RELAXED == conformanceMode(). Note that the representation of these byte sequences as C/C++ string literals requires that the escape character itself must be escaped: ` "Hello,\tworld\n"; // Can always initialize a JSON string with // containing tab and a newline // escape sequences // whether the option is set or not.
"Hello,tworldn"; // When this option is 'true'. // can also initialize a JSON string // with an actual and newline characters. ` Also note that the two resulting strings do not compare equal.
a non-const reference to this tokenizer
| Name | Description |
|---|---|
| value | new value for allowUnescapedControlCharacters |