1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
10 .\" References consulted:
11 .\" GNU glibc-2 source code and manual
12 .\" Dinkumware C library reference http://www.dinkumware.com/
13 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
16 .TH WCTOMB 3 2015-08-08 "GNU" "Linux Programmer's Manual"
18 wctomb \- convert a wide character to a multibyte sequence
21 .B #include <stdlib.h>
23 .BI "int wctomb(char *" s ", wchar_t " wc );
31 function converts the wide character
33 to its multibyte representation and stores it at the beginning of
34 the character array pointed to by
36 It updates the shift state, which
37 is stored in a static anonymous variable
41 and returns the length of said multibyte representation,
42 that is, the number of
46 The programmer must ensure that there is
57 .\" The Dinkumware doc and the Single UNIX specification say this, but
58 .\" glibc doesn't implement this.
59 resets the shift state, known only to this function,
60 to the initial state, and
61 returns nonzero if the encoding has nontrivial shift state,
62 or zero if the encoding is stateless.
69 returns the number of bytes
70 that have been written to the byte array at
75 represented as a multibyte sequence (according
76 to the current locale), \-1 is returned.
82 function returns nonzero if the
83 encoding has nontrivial shift state, or zero if the encoding is stateless.
85 For an explanation of the terms used in this section, see
91 Interface Attribute Value
94 T} Thread safety MT-Unsafe race
97 POSIX.1-2001, POSIX.1-2008, C99.
109 a better interface to the same functionality.