Files
cppdraft_translate/cppdraft/c/mb/wcs.md
2025-10-25 03:02:53 +03:00

4.3 KiB
Raw Blame History

[c.mb.wcs]

28 Text processing library [text]

28.7 Null-terminated sequence utilities [text.c.strings]

28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]

1

#

[Note 1:

The headers ,, and declare the functions described in this subclause.

— end note]

🔗

int mbsinit(const mbstate_t* ps); int mblen(const char* s, size_t n); size_t mbstowcs(wchar_t* pwcs, const char* s, size_t n); size_t wcstombs(char* s, const wchar_t* pwcs, size_t n);

2

#

Effects: These functions have the semantics specified in the C standard library.

See also: ISO/IEC 9899:2024, 7.22.7.1, 7.22.8, 7.29.6.2.1

🔗

int mbtowc(wchar_t* pwc, const char* s, size_t n); int wctomb(char* s, wchar_t wchar);

3

#

Effects: These functions have the semantics specified in the C standard library.

4

#

Remarks: Calls to these functions may introduce a data race ([res.on.data.races]) with other calls to the same function.

See also: ISO/IEC 9899:2024, 7.22.7

🔗

size_t [mbrlen](#lib:mbrlen "28.7.5Multibyte / wide string and character conversion functions[c.mb.wcs]")(const char* s, size_t n, mbstate_t* ps); size_t [mbrtowc](#lib:mbrtowc "28.7.5Multibyte / wide string and character conversion functions[c.mb.wcs]")(wchar_t* pwc, const char* s, size_t n, mbstate_t* ps); size_t [wcrtomb](#lib:wcrtomb "28.7.5Multibyte / wide string and character conversion functions[c.mb.wcs]")(char* s, wchar_t wc, mbstate_t* ps); size_t [mbrtoc8](#lib:mbrtoc8 "28.7.5Multibyte / wide string and character conversion functions[c.mb.wcs]")(char8_t* pc8, const char* s, size_t n, mbstate_t* ps); size_t [c8rtomb](#lib:c8rtomb "28.7.5Multibyte / wide string and character conversion functions[c.mb.wcs]")(char* s, char8_t c8, mbstate_t* ps); size_t [mbrtoc16](#lib:mbrtoc16 "28.7.5Multibyte / wide string and character conversion functions[c.mb.wcs]")(char16_t* pc16, const char* s, size_t n, mbstate_t* ps); size_t [c16rtomb](#lib:c16rtomb "28.7.5Multibyte / wide string and character conversion functions[c.mb.wcs]")(char* s, char16_t c16, mbstate_t* ps); size_t [mbrtoc32](#lib:mbrtoc32 "28.7.5Multibyte / wide string and character conversion functions[c.mb.wcs]")(char32_t* pc32, const char* s, size_t n, mbstate_t* ps); size_t [c32rtomb](#lib:c32rtomb "28.7.5Multibyte / wide string and character conversion functions[c.mb.wcs]")(char* s, char32_t c32, mbstate_t* ps); size_t [mbsrtowcs](#lib:mbsrtowcs "28.7.5Multibyte / wide string and character conversion functions[c.mb.wcs]")(wchar_t* dst, const char** src, size_t len, mbstate_t* ps); size_t [wcsrtombs](#lib:wcsrtombs "28.7.5Multibyte / wide string and character conversion functions[c.mb.wcs]")(char* dst, const wchar_t** src, size_t len, mbstate_t* ps);

5

#

Effects: These functions have the semantics specified in the C standard library.

6

#

Remarks: Calling these functions with an mbstate_t* argument that is a null pointer value may introduce a data race ([res.on.data.races]) with other calls to the same function with an mbstate_t* argument that is a null pointer value.

See also: ISO/IEC 9899:2024, 7.30.1, 7.31.6.3, 7.31.6.4