GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
BSON_ITER_UTF8(3) libbson BSON_ITER_UTF8(3)

#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);


  • iter: A bson_iter_t.
  • length: An optional location for the length of the resulting UTF-8 encoded string.

The bson_iter_utf8() function shall retrieve the contents of a BSON_TYPE_UTF8 element currently observed by iter.

It is invalid to call this function while observing an element other than BSON_TYPE_UTF8.

A UTF-8 encoded string that has not been modified or freed.

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 bson_utf8_validate() or validating the underlying bson_t before iterating it.

Note that not all drivers use multi-byte representation for \0 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.

MongoDB, Inc

2009-present, MongoDB, Inc.

July 3, 2025 1.30.4

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.