2 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
6 .\" References consulted:
7 .\" GNU glibc-2 source code and manual
8 .\" Dinkumware C library reference http://www.dinkumware.com/
9 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
12 .TH wctomb 3 (date) "Linux man-pages (unreleased)"
14 wctomb \- convert a wide character to a multibyte sequence
17 .RI ( libc ", " \-lc )
20 .B #include <stdlib.h>
22 .BI "int wctomb(char *" s ", wchar_t " wc );
30 function converts the wide character
32 to its multibyte representation and stores it at the beginning of
33 the character array pointed to by
35 It updates the shift state, which
36 is stored in a static anonymous variable
40 and returns the length of said multibyte representation,
41 that is, the number of
45 The programmer must ensure that there is
56 .\" The Dinkumware doc and the Single UNIX specification say this, but
57 .\" glibc doesn't implement this.
58 resets the shift state, known only to this function,
59 to the initial state, and
60 returns nonzero if the encoding has nontrivial shift state,
61 or zero if the encoding is stateless.
68 returns the number of bytes
69 that have been written to the byte array at
74 represented as a multibyte sequence (according
75 to the current locale), \-1 is returned.
81 function returns nonzero if the
82 encoding has nontrivial shift state, or zero if the encoding is stateless.
84 For an explanation of the terms used in this section, see
92 Interface Attribute Value
95 T} Thread safety MT-Unsafe race
101 POSIX.1-2001, POSIX.1-2008, C99.
113 a better interface to the same functionality.