You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library only supports UTF-8 encoding without BOM, as specified in [RFC 8259](https://datatracker.ietf.org/doc/html/rfc8259#section-8.1):
1564
+
By default, this library supports UTF-8 encoding without a BOM, as specified in [RFC 8259](https://datatracker.ietf.org/doc/html/rfc8259#section-8.1):
1553
1565
1554
1566
> JSON text exchanged between systems that are not part of a closed ecosystem MUST be encoded using UTF-8.
1555
1567
> Implementations MUST NOT add a byte order mark (U+FEFF) to the beginning of a networked-transmitted JSON text.
1556
1568
1557
-
By default, yyjson performs strict UTF-8 encoding validation on input strings. If an invalid character is encountered, an error will be reported.
1569
+
This library performs strict UTF-8 encoding validation on input strings by default. If an invalid character is encountered, an error will be reported.
1570
+
1571
+
To allow a BOM, use the `YYJSON_READ_ALLOW_BOM` or `YYJSON_READ_ALLOW_EXT_WHITESPACE` flags.
1558
1572
1559
-
You can use `YYJSON_READ_ALLOW_INVALID_UNICODE` and `YYJSON_WRITE_ALLOW_INVALID_UNICODE` flags to allow invalid Unicode encoding. However, please note that if you enable these flags, the resulting values from yyjson may contain invalid characters, which could be used by other code and introduce security risks.
1573
+
To allow invalid Unicode encoding, use the `YYJSON_READ_ALLOW_INVALID_UNICODE` and `YYJSON_WRITE_ALLOW_INVALID_UNICODE` flags. **Note:** Enabling these flags may result in yyjson producing values that contain invalid characters, which could be processed by other code and potentially introduce security risks.
1560
1574
1561
-
You can use `yyjson_set_str_noesc(yyjson_val *val, bool noesc)` or `yyjson_mut_set_str_noesc(yyjson_mut_val *val, bool noesc)` to mark a string as not needing to be escaped during JSON writing. This will make stringwriting faster and preserve the original string bytes.
1575
+
To mark a string as not requiring escaping during JSON writing, use `yyjson_set_str_noesc(yyjson_val *val, bool noesc)` or `yyjson_mut_set_str_noesc(yyjson_mut_val *val, bool noesc)`. This can improve string-writing performance and preserve the original string bytes.
1562
1576
1563
1577
## NUL Character
1564
1578
This library supports the `NUL` character (also known as the `null terminator`, or Unicode `U+0000`, ASCII `\0`) inside strings.
0 commit comments