---
name: "bson_iter_dup_utf8"
section: "3"
platform: "linux"
package: "libbson-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bson_iter_dup_utf8"
---

# bson\_iter\_dup\_utf8(3)

## SYNOPSIS

```
char *
bson_iter_dup_utf8 (const bson_iter_t *iter, uint32_t *length);
```

## PARAMETERS

- •

  **iter**: A *bson\_iter\_t*.

- •

  **length**: An optional location for the length of the UTF-8 encoded string.

## DESCRIPTION

This function is similar to *bson\_iter\_utf8()* except that it calls *bson\_strndup()* on the result.

## RETURNS

A newly allocated string that should be freed with *bson\_free()*.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
