📄 iconv_open.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>iconv_open</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="iconv_open"></a> <a name="tag_03_269"></a><!-- iconv_open --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_269_01"></a>NAME</h4><blockquote>iconv_open - codeset conversion allocation function</blockquote><h4><a name="tag_03_269_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> #include <<a href="../basedefs/iconv.h.html">iconv.h</a>><br><br> iconv_t iconv_open(const char *</tt><i>tocode</i><tt>, const char *</tt><i>fromcode</i><tt>); <img src="../images/opt-end.gif"alt="[Option End]" border="0"></tt></code></div><tt><br></tt></blockquote><h4><a name="tag_03_269_03"></a>DESCRIPTION</h4><blockquote><p>The <i>iconv_open</i>() function shall return a conversion descriptor that describes a conversion from the codeset specified bythe string pointed to by the <i>fromcode</i> argument to the codeset specified by the string pointed to by the <i>tocode</i>argument. For state-dependent encodings, the conversion descriptor shall be in a codeset-dependent initial shift state, ready forimmediate use with <a href="../functions/iconv.html"><i>iconv</i>()</a>.</p><p>Settings of <i>fromcode</i> and <i>tocode</i> and their permitted combinations are implementation-defined.</p><p>A conversion descriptor shall remain valid until it is closed by <a href="../functions/iconv_close.html"><i>iconv_close</i>()</a> or an implicit close.</p><p>If a file descriptor is used to implement conversion descriptors, the FD_CLOEXEC flag shall be set; see <a href="../basedefs/fcntl.h.html"><i><fcntl.h></i></a>.</p></blockquote><h4><a name="tag_03_269_04"></a>RETURN VALUE</h4><blockquote><p>Upon successful completion, <i>iconv_open</i>() shall return a conversion descriptor for use on subsequent calls to <a href="../functions/iconv.html"><i>iconv</i>()</a>. Otherwise, <i>iconv_open</i>() shall return (<b>iconv_t</b>)-1 and set <i>errno</i>to indicate the error.</p></blockquote><h4><a name="tag_03_269_05"></a>ERRORS</h4><blockquote><p>The <i>iconv_open</i>() function may fail if:</p><dl compact><dt>[EMFILE]</dt><dd>{OPEN_MAX} file descriptors are currently open in the calling process.</dd><dt>[ENFILE]</dt><dd>Too many files are currently open in the system.</dd><dt>[ENOMEM]</dt><dd>Insufficient storage space is available.</dd><dt>[EINVAL]</dt><dd>The conversion specified by <i>fromcode</i> and <i>tocode</i> is not supported by the implementation.</dd></dl></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_269_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_269_07"></a>APPLICATION USAGE</h4><blockquote><p>Some implementations of <i>iconv_open</i>() use <a href="../functions/malloc.html"><i>malloc</i>()</a> to allocate space forinternal buffer areas. The <i>iconv_open</i>() function may fail if there is insufficient storage space to accommodate thesebuffers.</p><p>Conforming applications must assume that conversion descriptors are not valid after a call to one of the <i><a href="../functions/exec.html">exec</a></i> functions.</p><p>Application developers should consult the system documentation to determine the supported codesets and their naming schemes.</p></blockquote><h4><a name="tag_03_269_08"></a>RATIONALE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_269_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_269_10"></a>SEE ALSO</h4><blockquote><p><a href="iconv.html"><i>iconv</i>()</a> , <a href="iconv_close.html"><i>iconv_close</i>()</a> , the Base Definitions volume ofIEEE Std 1003.1-2001, <a href="../basedefs/fcntl.h.html"><i><fcntl.h></i></a>, <a href="../basedefs/iconv.h.html"><i><iconv.h></i></a></p></blockquote><h4><a name="tag_03_269_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 4. Derived from the HP-UX Manual.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -