1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" References consulted:
9 .\" GNU glibc-2 source code and manual
10 .\" Dinkumware C library reference http://www.dinkumware.com/
11 .\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html
14 .TH WCTOMB 3 1999-07-25 "GNU" "Linux Programmer's Manual"
16 wctomb \- convert a wide character to a multibyte sequence
19 .B #include <stdlib.h>
21 .BI "int wctomb(char *" s ", wchar_t " wc );
24 If \fIs\fP is not NULL,
27 function converts the wide character
28 \fIwc\fP to its multibyte representation and stores it at the beginning of
29 the character array pointed to by \fIs\fP.
30 It updates the shift state, which
31 is stored in a static anonymous variable
32 only known to the wctomb function,
33 and returns the length of said multibyte representation,
34 that is, the number of
35 bytes written at \fIs\fP.
37 The programmer must ensure that there is
38 room for at least \fBMB_CUR_MAX\fP
41 If \fIs\fP is NULL, the
44 .\" The Dinkumware doc and the Single Unix specification say this, but
45 .\" glibc doesn't implement this.
46 resets the shift state, only known to this function,
47 to the initial state, and
48 returns non-zero if the encoding has non-trivial shift state,
49 or zero if the encoding is stateless.
51 If \fIs\fP is not NULL, the
54 returns the number of bytes
55 that have been written to the byte array at \fIs\fP.
56 If \fIwc\fP can not be
57 represented as a multibyte sequence (according
58 to the current locale), \-1 is returned.
60 If \fIs\fP is NULL, the
62 function returns non-zero if the
63 encoding has non-trivial shift state, or zero if the encoding is stateless.
74 This function is not multi-thread safe.
78 a better interface to the same functionality.