From 82ba818ff456bcd6d56a06226e3f27e98fbb55c3 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 14 Aug 2025 22:58:58 -0500 Subject: removing all downloaded devdocs files --- devdocs/c/string%2Fmultibyte%2Fmbsinit.html | 50 ----------------------------- 1 file changed, 50 deletions(-) delete mode 100644 devdocs/c/string%2Fmultibyte%2Fmbsinit.html (limited to 'devdocs/c/string%2Fmultibyte%2Fmbsinit.html') diff --git a/devdocs/c/string%2Fmultibyte%2Fmbsinit.html b/devdocs/c/string%2Fmultibyte%2Fmbsinit.html deleted file mode 100644 index 0f1c9207..00000000 --- a/devdocs/c/string%2Fmultibyte%2Fmbsinit.html +++ /dev/null @@ -1,50 +0,0 @@ -

mbsinit

Defined in header <wchar.h>
int mbsinit( const mbstate_t* ps);
-
(since C95)

If ps is not a null pointer, the mbsinit function determines whether the pointed-to mbstate_t object describes the initial conversion state.

-

Notes

Although a zero-initialized mbstate_t always represents the initial conversion state, there may be other values of mbstate_t that also represent the initial conversion state.

-

Parameters

- -
ps - pointer to the mbstate_t object to examine

Return value

​0​ if ps is not a null pointer and does not represent the initial conversion state, nonzero value otherwise.

-

Example

#include <locale.h>
-#include <string.h>
-#include <stdio.h>
-#include <wchar.h>
- 
-int main(void)
-{
-    // allow mbrlen() to work with UTF-8 multibyte encoding
-    setlocale(LC_ALL, "en_US.utf8");
-    // UTF-8 narrow multibyte encoding
-    const char* str = u8"水"; // or u8"\u6c34" or "\xe6\xb0\xb4"
-    static mbstate_t mb; // zero-initialize
-    (void)mbrlen(&str[0], 1, &mb);
-    if (!mbsinit(&mb)) {
-        printf("After processing the first 1 byte of %s,\n"
-               "the conversion state is not initial\n\n", str);
-    }
- 
-    (void)mbrlen(&str[1], strlen(str), &mb);
-    if (mbsinit(&mb)) {
-        printf("After processing the remaining 2 bytes of %s,\n"
-               "the conversion state is initial conversion state\n", str);
-    }
-}

Output:

-
After processing the first 1 byte of 水,
-the conversion state is not initial
- 
-After processing the remaining 2 bytes of 水,
-the conversion state is initial conversion state

References

See also

- -
-
(C95)
conversion state information necessary to iterate multibyte character strings
(class)
C++ documentation for mbsinit
-

- © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
- https://en.cppreference.com/w/c/string/multibyte/mbsinit -

-
-- cgit v1.2.3