BSON_UTF8_ESCAPE_FOR_JSON(3) | libbson | BSON_UTF8_ESCAPE_FOR_JSON(3) |
bson_utf8_escape_for_json - bson_utf8_escape_for_json()
char * bson_utf8_escape_for_json (const char *utf8, ssize_t utf8_len);
Allocates a new string matching utf8 except that special characters in JSON are escaped. The resulting string is also UTF-8 encoded.
Both " and \ characters will be backslash-escaped. If a NUL byte is found before utf8_len bytes, it is converted to "\u0000". Other non-ASCII characters in the input are preserved.
A newly allocated string that should be freed with bson_free().
MongoDB, Inc
2017-present, MongoDB, Inc
October 20, 2022 | 1.23.1 |