📄 wctomb.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>wctomb</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_010_698"> </a>NAME</h4><blockquote>wctomb - convert a wide-character code to a character</blockquote><h4><a name = "tag_000_010_699"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="stdlib.h.html">stdlib.h</a>>int wctomb(char *<i>s</i>, wchar_t <i>wchar</i>);</code></pre></blockquote><h4><a name = "tag_000_010_700"> </a>DESCRIPTION</h4><blockquote>The<i>wctomb()</i>function determines the number of bytes needed to represent thecharacter corresponding to thewide-character code whosevalue is<i>wchar</i>(including any change in the shift state).It stores the character representation (possiblymultiple bytes and any specialbytes to change shift state) in the arrayobject pointed to by<i>s</i>(if<i>s</i>is not a null pointer). At most {MB_CUR_MAX} bytes are stored. If<i>wchar</i>is 0,<i>wctomb()</i>is left in the initial shift state.<p>The behaviour of this function is affected by the LC_CTYPE categoryof the current locale.For a state-dependent encoding, this function is placed into itsinitial state by a call for which its character pointer argument,<i>s</i>,is a null pointer.Subsequent calls with<i>s</i>as other than a null pointer cause the internal state of the function to bealtered as necessary. A call with<i>s</i>as a null pointer causes this function to return a non-zerovalue if encodings have state dependency, and 0 otherwise.Changing the LC_CTYPE category causes the shift state of thisfunction to be indeterminate.<p>The implementation will behave as if no function defined in this documentcalls<i>wctomb()</i>.</blockquote><h4><a name = "tag_000_010_701"> </a>RETURN VALUE</h4><blockquote>If<i>s</i>is a null pointer,<i>wctomb()</i>returns a non-zero or 0 value, if character encodings, respectively, do ordo not have state-dependent encodings. If<i>s</i>is not a null pointer,<i>wctomb()</i>returns -1 if the value of<i>wchar</i>does not correspond to a valid character, or returnsthe number of bytes that constitute the charactercorresponding to the value of<i>wchar</i>.<p>In no case will the value returned be greater than the value ofthe MB_CUR_MAX macro.</blockquote><h4><a name = "tag_000_010_702"> </a>ERRORS</h4><blockquote>No errors are defined.</blockquote><h4><a name = "tag_000_010_703"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_704"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_705"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_706"> </a>SEE ALSO</h4><blockquote><i><a href="mblen.html">mblen()</a></i>,<i><a href="mbtowc.html">mbtowc()</a></i>,<i><a href="mbstowcs.html">mbstowcs()</a></i>,<i><a href="wcstombs.html">wcstombs()</a></i>,<i><a href="stdlib.h.html"><stdlib.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from the ANSI C standard.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -