bson_utf8_escape_for_json() — libbson 1.6.3

- libbson 1.6.3 »
- API Reference »
- bson_string_t

# bson_utf8_escape_for_json()

## Synopsis

    char *
    bson_utf8_escape_for_json (const char *utf8, ssize_t utf8_len);

## Parameters

- `utf8`: A UTF-8 encoded string.
- `utf8_len`: The length of `utf8` in bytes or -1 if it is NULL terminated.

## Description

Escapes the string `utf8` to be placed inside of a JSON string.

## Returns

A newly allocated string that should be freed with bson_free().

Created using Sphinx 1.5.3, based on Sphinx Readable Theme.