1BSON_UTF8(3) libbson BSON_UTF8(3)
2
3
4
6 Libbson expects that you are always working with UTF-8 encoded text.
7 Anything else is invalid API use.
8
9 If you should need to walk through UTF-8 sequences, you can use the
10 various UTF-8 helper functions distributed with Libbson.
11
13 To validate the string contained in my_string, use the following. You
14 may pass -1 for the string length if you know the string is NULL-termi‐
15 nated.
16
17 if (!bson_utf8_validate (my_string, -1, false)) {
18 printf ("Validation failed.\n");
19 }
20
21 If my_string has NULL bytes within the string, you must provide the
22 string length. Use the following format. Notice the true at the end in‐
23 dicating \0 is allowed.
24
25 if (!bson_utf8_validate (my_string, my_string_len, true)) {
26 printf ("Validation failed.\n");
27 }
28
29 For more information see the API reference for bson_utf8_validate().
30
32 MongoDB, Inc
33
35 2017-present, MongoDB, Inc
36
37
38
39
401.25.1 Nov 08, 2023 BSON_UTF8(3)