.\" Man page generated from reStructuredText. . .TH "BSON_ITER_UTF8" "3" "Jun 04, 2021" "1.17.6" "libbson" .SH NAME bson_iter_utf8 \- bson_iter_utf8() . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C #define BSON_ITER_HOLDS_UTF8(iter) (bson_iter_type ((iter)) == BSON_TYPE_UTF8) const char * bson_iter_utf8 (const bson_iter_t *iter, uint32_t *length); .ft P .fi .UNINDENT .UNINDENT .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBiter\fP: A \fBbson_iter_t\fP\&. .IP \(bu 2 \fBlength\fP: An optional location for the length of the resulting UTF\-8 encoded string. .UNINDENT .SH DESCRIPTION .sp The \fBbson_iter_utf8()\fP function shall retrieve the contents of a BSON_TYPE_UTF8 element currently observed by \fBiter\fP\&. .sp It is invalid to call this function while observing an element other than BSON_TYPE_UTF8. .SH RETURNS .sp A UTF\-8 encoded string that has not been modified or freed. .sp It is suggested that the caller validate the content is valid UTF\-8 before using this in other places. That can be done by calling \fBbson_utf8_validate()\fP or validating the underlying \fBbson_t\fP before iterating it. .sp Note that not all drivers use multi\-byte representation for \fB\e0\fP in UTF\-8 encodings (commonly referred to as modified\-UTF8). You probably want to take a look at the length field when marshaling to other runtimes. .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .