%PDF- %PDF-
Direktori : /usr/local/share/gtk-doc/html/libidn2/ |
Current File : //usr/local/share/gtk-doc/html/libidn2/libidn2-idn2.h.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>idn2.h: Libidn2 Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"> <link rel="home" href="index.html" title="Libidn2 Reference Manual"> <link rel="up" href="libidn2.html" title="Libidn2 Overview"> <link rel="prev" href="libidn2.html" title="Libidn2 Overview"> <link rel="next" href="api-index-full.html" title="API Index"> <meta name="generator" content="GTK-Doc V1.33.1 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> <td width="100%" align="left" class="shortcuts"> <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> <a href="#libidn2-idn2.h.description" class="shortcut">Description</a></span> </td> <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> <td><a accesskey="u" href="libidn2.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="libidn2.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="api-index-full.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="refentry"> <a name="libidn2-idn2.h"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="libidn2-idn2.h.top_of_page"></a>idn2.h</span></h2> <p>idn2.h — main library interfaces</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="libidn2-idn2.h.functions"></a><h2>Functions</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="functions_proto_type"> <col class="functions_proto_name"> </colgroup> <tbody> <tr> <td class="define_keyword">#define</td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#GCC-VERSION-AT-LEAST:CAPS" title="GCC_VERSION_AT_LEAST()">GCC_VERSION_AT_LEAST</a><span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-lookup-u8" title="idn2_lookup_u8 ()">idn2_lookup_u8</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-register-u8" title="idn2_register_u8 ()">idn2_register_u8</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-lookup-ul" title="idn2_lookup_ul ()">idn2_lookup_ul</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-register-ul" title="idn2_register_ul ()">idn2_register_ul</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-to-ascii-4i" title="idn2_to_ascii_4i ()">idn2_to_ascii_4i</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-to-ascii-4i2" title="idn2_to_ascii_4i2 ()">idn2_to_ascii_4i2</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-to-ascii-4z" title="idn2_to_ascii_4z ()">idn2_to_ascii_4z</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-to-ascii-8z" title="idn2_to_ascii_8z ()">idn2_to_ascii_8z</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-to-ascii-lz" title="idn2_to_ascii_lz ()">idn2_to_ascii_lz</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-to-unicode-8z4z" title="idn2_to_unicode_8z4z ()">idn2_to_unicode_8z4z</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-to-unicode-4z4z" title="idn2_to_unicode_4z4z ()">idn2_to_unicode_4z4z</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-to-unicode-44i" title="idn2_to_unicode_44i ()">idn2_to_unicode_44i</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-to-unicode-8z8z" title="idn2_to_unicode_8z8z ()">idn2_to_unicode_8z8z</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-to-unicode-8zlz" title="idn2_to_unicode_8zlz ()">idn2_to_unicode_8zlz</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">int</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-to-unicode-lzlz" title="idn2_to_unicode_lzlz ()">idn2_to_unicode_lzlz</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type">const <span class="returnvalue">char</span> * </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-strerror" title="idn2_strerror ()">idn2_strerror</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type">const <span class="returnvalue">char</span> * </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-strerror-name" title="idn2_strerror_name ()">idn2_strerror_name</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type">const <span class="returnvalue">char</span> * </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-check-version" title="idn2_check_version ()">idn2_check_version</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="libidn2-idn2.h.html#idn2-free" title="idn2_free ()">idn2_free</a> <span class="c_punctuation">()</span> </td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="libidn2-idn2.h.other"></a><h2>Types and Values</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="other_proto_type"> <col class="other_proto_name"> </colgroup> <tbody> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#G-GNUC-IDN2-ATTRIBUTE-PURE:CAPS" title="G_GNUC_IDN2_ATTRIBUTE_PURE">G_GNUC_IDN2_ATTRIBUTE_PURE</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#G-GNUC-IDN2-ATTRIBUTE-CONST:CAPS" title="G_GNUC_IDN2_ATTRIBUTE_CONST">G_GNUC_IDN2_ATTRIBUTE_CONST</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#G-GNUC-DEPRECATED:CAPS" title="G_GNUC_DEPRECATED">G_GNUC_DEPRECATED</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#G-GNUC-UNUSED:CAPS" title="G_GNUC_UNUSED">G_GNUC_UNUSED</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#IDN2-VERSION:CAPS" title="IDN2_VERSION">IDN2_VERSION</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#IDN2-VERSION-NUMBER:CAPS" title="IDN2_VERSION_NUMBER">IDN2_VERSION_NUMBER</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#IDN2-VERSION-MAJOR:CAPS" title="IDN2_VERSION_MAJOR">IDN2_VERSION_MAJOR</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#IDN2-VERSION-MINOR:CAPS" title="IDN2_VERSION_MINOR">IDN2_VERSION_MINOR</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#IDN2-VERSION-PATCH:CAPS" title="IDN2_VERSION_PATCH">IDN2_VERSION_PATCH</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#IDN2-LABEL-MAX-LENGTH:CAPS" title="IDN2_LABEL_MAX_LENGTH">IDN2_LABEL_MAX_LENGTH</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#IDN2-DOMAIN-MAX-LENGTH:CAPS" title="IDN2_DOMAIN_MAX_LENGTH">IDN2_DOMAIN_MAX_LENGTH</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#idn2-flags" title="enum idn2_flags">idn2_flags</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="libidn2-idn2.h.html#idn2-rc" title="enum idn2_rc">idn2_rc</a></td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="libidn2-idn2.h.description"></a><h2>Description</h2> <p>The main library interfaces are declared in idn2.h.</p> </div> <div class="refsect1"> <a name="libidn2-idn2.h.functions_details"></a><h2>Functions</h2> <div class="refsect2"> <a name="GCC-VERSION-AT-LEAST:CAPS"></a><h3>GCC_VERSION_AT_LEAST()</h3> <pre class="programlisting"># define GCC_VERSION_AT_LEAST(major, minor) ((__GNUC__ > (major)) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) </pre> <p>Pre-processor symbol to check the gcc version.</p> <div class="refsect3"> <a name="GCC-VERSION-AT-LEAST.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>major</p></td> <td class="parameter_description"><p>gcc major version number to compare with</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>minor</p></td> <td class="parameter_description"><p>gcc minor version number to compare with</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="idn2-lookup-u8"></a><h3>idn2_lookup_u8 ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_lookup_u8 (<em class="parameter"><code>const <span class="type">uint8_t</span> *src</code></em>, <em class="parameter"><code><span class="type">uint8_t</span> **lookupname</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Perform IDNA2008 lookup string conversion on domain name <em class="parameter"><code>src</code></em> , as described in section 5 of RFC 5891. Note that the input string must be encoded in UTF-8 and be in Unicode NFC form.</p> <p>Pass <a class="link" href="libidn2-idn2.h.html#IDN2-NFC-INPUT:CAPS"><code class="literal">IDN2_NFC_INPUT</code></a> in <em class="parameter"><code>flags</code></em> to convert input to NFC form before further processing. <a class="link" href="libidn2-idn2.h.html#IDN2-TRANSITIONAL:CAPS"><code class="literal">IDN2_TRANSITIONAL</code></a> and <a class="link" href="libidn2-idn2.h.html#IDN2-NONTRANSITIONAL:CAPS"><code class="literal">IDN2_NONTRANSITIONAL</code></a> do already imply <a class="link" href="libidn2-idn2.h.html#IDN2-NFC-INPUT:CAPS"><code class="literal">IDN2_NFC_INPUT</code></a>.</p> <p>Pass <a class="link" href="libidn2-idn2.h.html#IDN2-ALABEL-ROUNDTRIP:CAPS"><code class="literal">IDN2_ALABEL_ROUNDTRIP</code></a> in <em class="parameter"><code>flags</code></em> to convert any input A-labels to U-labels and perform additional testing. This is default since version 2.2. To switch this behavior off, pass IDN2_NO_ALABEL_ROUNDTRIP</p> <p>Pass <a class="link" href="libidn2-idn2.h.html#IDN2-TRANSITIONAL:CAPS"><code class="literal">IDN2_TRANSITIONAL</code></a> to enable Unicode TR46 transitional processing, and <a class="link" href="libidn2-idn2.h.html#IDN2-NONTRANSITIONAL:CAPS"><code class="literal">IDN2_NONTRANSITIONAL</code></a> to enable Unicode TR46 non-transitional processing.</p> <p>Multiple flags may be specified by binary or:ing them together.</p> <p>After version 2.0.3: <a class="link" href="libidn2-idn2.h.html#IDN2-USE-STD3-ASCII-RULES:CAPS"><code class="literal">IDN2_USE_STD3_ASCII_RULES</code></a> disabled by default. Previously we were eliminating non-STD3 characters from domain strings such as _443._tcp.example.com, or IPs 1.2.3.4/24 provided to libidn2 functions. That was an unexpected regression for applications switching from libidn and thus it is no longer applied by default. Use <a class="link" href="libidn2-idn2.h.html#IDN2-USE-STD3-ASCII-RULES:CAPS"><code class="literal">IDN2_USE_STD3_ASCII_RULES</code></a> to enable that behavior again.</p> <p>After version 0.11: <em class="parameter"><code>lookupname</code></em> may be NULL to test lookup of <em class="parameter"><code>src</code></em> without allocating memory.</p> <div class="refsect3"> <a name="idn2-lookup-u8.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>src</p></td> <td class="parameter_description"><p>input zero-terminated UTF-8 string in Unicode NFC normalized form.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>lookupname</p></td> <td class="parameter_description"><p>newly allocated output variable with name to lookup in DNS.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>optional <a class="link" href="libidn2-idn2.h.html#idn2-flags" title="enum idn2_flags"><span class="type">idn2_flags</span></a> to modify behaviour.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-lookup-u8.returns"></a><h4>Returns</h4> <p> On successful conversion <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a> is returned, if the output domain or any label would have been too long <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-DOMAIN:CAPS"><code class="literal">IDN2_TOO_BIG_DOMAIN</code></a> or <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-LABEL:CAPS"><code class="literal">IDN2_TOO_BIG_LABEL</code></a> is returned, or another error code is returned.</p> </div> <p class="since">Since: <a class="link" href="api-index-0.1.html" title="Index of new API in 0.1">0.1</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-register-u8"></a><h3>idn2_register_u8 ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_register_u8 (<em class="parameter"><code>const <span class="type">uint8_t</span> *ulabel</code></em>, <em class="parameter"><code>const <span class="type">uint8_t</span> *alabel</code></em>, <em class="parameter"><code><span class="type">uint8_t</span> **insertname</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Perform IDNA2008 register string conversion on domain label <em class="parameter"><code>ulabel</code></em> and <em class="parameter"><code>alabel</code></em> , as described in section 4 of RFC 5891. Note that the input <em class="parameter"><code>ulabel</code></em> must be encoded in UTF-8 and be in Unicode NFC form.</p> <p>Pass <a class="link" href="libidn2-idn2.h.html#IDN2-NFC-INPUT:CAPS"><code class="literal">IDN2_NFC_INPUT</code></a> in <em class="parameter"><code>flags</code></em> to convert input <em class="parameter"><code>ulabel</code></em> to NFC form before further processing.</p> <p>It is recommended to supply both <em class="parameter"><code>ulabel</code></em> and <em class="parameter"><code>alabel</code></em> for better error checking, but supplying just one of them will work. Passing in only <em class="parameter"><code>alabel</code></em> is better than only <em class="parameter"><code>ulabel</code></em> . See RFC 5891 section 4 for more information.</p> <p>After version 0.11: <em class="parameter"><code>insertname</code></em> may be NULL to test conversion of <em class="parameter"><code>src</code></em> without allocating memory.</p> <div class="refsect3"> <a name="idn2-register-u8.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>ulabel</p></td> <td class="parameter_description"><p>input zero-terminated UTF-8 and Unicode NFC string, or NULL.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>alabel</p></td> <td class="parameter_description"><p>input zero-terminated ACE encoded string (xn--), or NULL.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>insertname</p></td> <td class="parameter_description"><p>newly allocated output variable with name to register in DNS.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>optional <a class="link" href="libidn2-idn2.h.html#idn2-flags" title="enum idn2_flags"><span class="type">idn2_flags</span></a> to modify behaviour.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-register-u8.returns"></a><h4>Returns</h4> <p> On successful conversion <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a> is returned, when the given <em class="parameter"><code>ulabel</code></em> and <em class="parameter"><code>alabel</code></em> does not match each other <a class="link" href="libidn2-idn2.h.html#IDN2-UALABEL-MISMATCH:CAPS"><code class="literal">IDN2_UALABEL_MISMATCH</code></a> is returned, when either of the input labels are too long <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-LABEL:CAPS"><code class="literal">IDN2_TOO_BIG_LABEL</code></a> is returned, when <em class="parameter"><code>alabel</code></em> does does not appear to be a proper A-label <a class="link" href="libidn2-idn2.h.html#IDN2-INVALID-ALABEL:CAPS"><code class="literal">IDN2_INVALID_ALABEL</code></a> is returned, or another error code is returned.</p> </div> </div> <hr> <div class="refsect2"> <a name="idn2-lookup-ul"></a><h3>idn2_lookup_ul ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_lookup_ul (<em class="parameter"><code>const <span class="type">char</span> *src</code></em>, <em class="parameter"><code><span class="type">char</span> **lookupname</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Perform IDNA2008 lookup string conversion on domain name <em class="parameter"><code>src</code></em> , as described in section 5 of RFC 5891. Note that the input is assumed to be encoded in the locale's default coding system, and will be transcoded to UTF-8 and NFC normalized by this function.</p> <p>Pass <a class="link" href="libidn2-idn2.h.html#IDN2-ALABEL-ROUNDTRIP:CAPS"><code class="literal">IDN2_ALABEL_ROUNDTRIP</code></a> in <em class="parameter"><code>flags</code></em> to convert any input A-labels to U-labels and perform additional testing. This is default since version 2.2. To switch this behavior off, pass IDN2_NO_ALABEL_ROUNDTRIP</p> <p>Pass <a class="link" href="libidn2-idn2.h.html#IDN2-TRANSITIONAL:CAPS"><code class="literal">IDN2_TRANSITIONAL</code></a> to enable Unicode TR46 transitional processing, and <a class="link" href="libidn2-idn2.h.html#IDN2-NONTRANSITIONAL:CAPS"><code class="literal">IDN2_NONTRANSITIONAL</code></a> to enable Unicode TR46 non-transitional processing.</p> <p>Multiple flags may be specified by binary or:ing them together, for example <a class="link" href="libidn2-idn2.h.html#IDN2-ALABEL-ROUNDTRIP:CAPS"><code class="literal">IDN2_ALABEL_ROUNDTRIP</code></a> | <a class="link" href="libidn2-idn2.h.html#IDN2-NONTRANSITIONAL:CAPS"><code class="literal">IDN2_NONTRANSITIONAL</code></a>.</p> <p>The <a class="link" href="libidn2-idn2.h.html#IDN2-NFC-INPUT:CAPS"><code class="literal">IDN2_NFC_INPUT</code></a> in <em class="parameter"><code>flags</code></em> is always enabled in this function.</p> <p>After version 0.11: <em class="parameter"><code>lookupname</code></em> may be NULL to test lookup of <em class="parameter"><code>src</code></em> without allocating memory.</p> <div class="refsect3"> <a name="idn2-lookup-ul.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>src</p></td> <td class="parameter_description"><p>input zero-terminated locale encoded string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>lookupname</p></td> <td class="parameter_description"><p>newly allocated output variable with name to lookup in DNS.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>optional <a class="link" href="libidn2-idn2.h.html#idn2-flags" title="enum idn2_flags"><span class="type">idn2_flags</span></a> to modify behaviour.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-lookup-ul.returns"></a><h4>Returns</h4> <p> On successful conversion <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a> is returned, if conversion from locale to UTF-8 fails then <a class="link" href="libidn2-idn2.h.html#IDN2-ICONV-FAIL:CAPS"><code class="literal">IDN2_ICONV_FAIL</code></a> is returned, if the output domain or any label would have been too long <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-DOMAIN:CAPS"><code class="literal">IDN2_TOO_BIG_DOMAIN</code></a> or <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-LABEL:CAPS"><code class="literal">IDN2_TOO_BIG_LABEL</code></a> is returned, or another error code is returned.</p> </div> <p class="since">Since: <a class="link" href="api-index-0.1.html" title="Index of new API in 0.1">0.1</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-register-ul"></a><h3>idn2_register_ul ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_register_ul (<em class="parameter"><code>const <span class="type">char</span> *ulabel</code></em>, <em class="parameter"><code>const <span class="type">char</span> *alabel</code></em>, <em class="parameter"><code><span class="type">char</span> **insertname</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Perform IDNA2008 register string conversion on domain label <em class="parameter"><code>ulabel</code></em> and <em class="parameter"><code>alabel</code></em> , as described in section 4 of RFC 5891. Note that the input <em class="parameter"><code>ulabel</code></em> is assumed to be encoded in the locale's default coding system, and will be transcoded to UTF-8 and NFC normalized by this function.</p> <p>It is recommended to supply both <em class="parameter"><code>ulabel</code></em> and <em class="parameter"><code>alabel</code></em> for better error checking, but supplying just one of them will work. Passing in only <em class="parameter"><code>alabel</code></em> is better than only <em class="parameter"><code>ulabel</code></em> . See RFC 5891 section 4 for more information.</p> <p>After version 0.11: <em class="parameter"><code>insertname</code></em> may be NULL to test conversion of <em class="parameter"><code>src</code></em> without allocating memory.</p> <div class="refsect3"> <a name="idn2-register-ul.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>ulabel</p></td> <td class="parameter_description"><p>input zero-terminated locale encoded string, or NULL.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>alabel</p></td> <td class="parameter_description"><p>input zero-terminated ACE encoded string (xn--), or NULL.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>insertname</p></td> <td class="parameter_description"><p>newly allocated output variable with name to register in DNS.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>optional <a class="link" href="libidn2-idn2.h.html#idn2-flags" title="enum idn2_flags"><span class="type">idn2_flags</span></a> to modify behaviour.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-register-ul.returns"></a><h4>Returns</h4> <p> On successful conversion <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a> is returned, when the given <em class="parameter"><code>ulabel</code></em> and <em class="parameter"><code>alabel</code></em> does not match each other <a class="link" href="libidn2-idn2.h.html#IDN2-UALABEL-MISMATCH:CAPS"><code class="literal">IDN2_UALABEL_MISMATCH</code></a> is returned, when either of the input labels are too long <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-LABEL:CAPS"><code class="literal">IDN2_TOO_BIG_LABEL</code></a> is returned, when <em class="parameter"><code>alabel</code></em> does does not appear to be a proper A-label <a class="link" href="libidn2-idn2.h.html#IDN2-INVALID-ALABEL:CAPS"><code class="literal">IDN2_INVALID_ALABEL</code></a> is returned, when <em class="parameter"><code>ulabel</code></em> locale to UTF-8 conversion failed <a class="link" href="libidn2-idn2.h.html#IDN2-ICONV-FAIL:CAPS"><code class="literal">IDN2_ICONV_FAIL</code></a> is returned, or another error code is returned.</p> </div> </div> <hr> <div class="refsect2"> <a name="idn2-to-ascii-4i"></a><h3>idn2_to_ascii_4i ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_to_ascii_4i (<em class="parameter"><code>const <span class="type">uint32_t</span> *input</code></em>, <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>, <em class="parameter"><code><span class="type">char</span> *output</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <div class="warning"> <p><code class="literal">idn2_to_ascii_4i</code> has been deprecated since version 2.1.1 and should not be used in newly-written code.</p> <p>Use <a class="link" href="libidn2-idn2.h.html#idn2-to-ascii-4i2" title="idn2_to_ascii_4i2 ()"><code class="function">idn2_to_ascii_4i2()</code></a>.</p> </div> <p>THIS FUNCTION HAS BEEN DEPRECATED DUE TO A DESIGN FLAW. USE <a class="link" href="libidn2-idn2.h.html#idn2-to-ascii-4i2" title="idn2_to_ascii_4i2 ()"><code class="function">idn2_to_ascii_4i2()</code></a> INSTEAD !</p> <p>The ToASCII operation takes a sequence of Unicode code points that make up one domain label and transforms it into a sequence of code points in the ASCII range (0..7F). If ToASCII succeeds, the original sequence and the resulting sequence are equivalent labels.</p> <p>It is important to note that the ToASCII operation can fail. ToASCII fails if any step of it fails. If any step of the ToASCII operation fails on any label in a domain name, that domain name MUST NOT be used as an internationalized domain name. The method for dealing with this failure is application-specific.</p> <p>The inputs to ToASCII are a sequence of code points.</p> <p>ToASCII never alters a sequence of code points that are all in the ASCII range to begin with (although it could fail). Applying the ToASCII operation multiple effect as applying it just once.</p> <p>The default behavior of this function (when flags are zero) is to apply the IDNA2008 rules without the TR46 amendments. As the TR46 non-transitional processing is nowadays ubiquitous, when unsure, it is recommended to call this function with the <a class="link" href="libidn2-idn2.h.html#IDN2-NONTRANSITIONAL:CAPS"><code class="literal">IDN2_NONTRANSITIONAL</code></a> and the <a class="link" href="libidn2-idn2.h.html#IDN2-NFC-INPUT:CAPS"><code class="literal">IDN2_NFC_INPUT</code></a> flags for compatibility with other software.</p> <div class="refsect3"> <a name="idn2-to-ascii-4i.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>input</p></td> <td class="parameter_description"><p>zero terminated input Unicode (UCS-4) string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>inlen</p></td> <td class="parameter_description"><p>number of elements in <em class="parameter"><code>input</code></em> .</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>output</p></td> <td class="parameter_description"><p>output zero terminated string that must have room for at least 63 characters plus the terminating zero.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>optional <a class="link" href="libidn2-idn2.h.html#idn2-flags" title="enum idn2_flags"><span class="type">idn2_flags</span></a> to modify behaviour.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-to-ascii-4i.returns"></a><h4>Returns</h4> <p> Returns <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a> on success, or error code.</p> </div> <p class="since">Since: <a class="link" href="api-index-2.0.0.html" title="Index of new API in 2.0.0">2.0.0</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-to-ascii-4i2"></a><h3>idn2_to_ascii_4i2 ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_to_ascii_4i2 (<em class="parameter"><code>const <span class="type">uint32_t</span> *input</code></em>, <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>, <em class="parameter"><code><span class="type">char</span> **output</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>The ToASCII operation takes a sequence of Unicode code points that make up one domain label and transforms it into a sequence of code points in the ASCII range (0..7F). If ToASCII succeeds, the original sequence and the resulting sequence are equivalent labels.</p> <p>It is important to note that the ToASCII operation can fail. ToASCII fails if any step of it fails. If any step of the ToASCII operation fails on any label in a domain name, that domain name MUST NOT be used as an internationalized domain name. The method for dealing with this failure is application-specific.</p> <p>The inputs to ToASCII are a sequence of code points.</p> <p>ToASCII never alters a sequence of code points that are all in the ASCII range to begin with (although it could fail). Applying the ToASCII operation multiple effect as applying it just once.</p> <p>The default behavior of this function (when flags are zero) is to apply the IDNA2008 rules without the TR46 amendments. As the TR46 non-transitional processing is nowadays ubiquitous, when unsure, it is recommended to call this function with the <a class="link" href="libidn2-idn2.h.html#IDN2-NONTRANSITIONAL:CAPS"><code class="literal">IDN2_NONTRANSITIONAL</code></a> and the <a class="link" href="libidn2-idn2.h.html#IDN2-NFC-INPUT:CAPS"><code class="literal">IDN2_NFC_INPUT</code></a> flags for compatibility with other software.</p> <div class="refsect3"> <a name="idn2-to-ascii-4i2.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>input</p></td> <td class="parameter_description"><p>zero terminated input Unicode (UCS-4) string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>inlen</p></td> <td class="parameter_description"><p>number of elements in <em class="parameter"><code>input</code></em> .</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>output</p></td> <td class="parameter_description"><p>pointer to newly allocated zero-terminated output string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>optional <a class="link" href="libidn2-idn2.h.html#idn2-flags" title="enum idn2_flags"><span class="type">idn2_flags</span></a> to modify behaviour.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-to-ascii-4i2.returns"></a><h4>Returns</h4> <p> Returns <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a> on success, or error code.</p> </div> <p class="since">Since: <a class="link" href="api-index-2.1.1.html" title="Index of new API in 2.1.1">2.1.1</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-to-ascii-4z"></a><h3>idn2_to_ascii_4z ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_to_ascii_4z (<em class="parameter"><code>const <span class="type">uint32_t</span> *input</code></em>, <em class="parameter"><code><span class="type">char</span> **output</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Convert UCS-4 domain name to ASCII string using the IDNA2008 rules. The domain name may contain several labels, separated by dots. The output buffer must be deallocated by the caller.</p> <p>The default behavior of this function (when flags are zero) is to apply the IDNA2008 rules without the TR46 amendments. As the TR46 non-transitional processing is nowadays ubiquitous, when unsure, it is recommended to call this function with the <a class="link" href="libidn2-idn2.h.html#IDN2-NONTRANSITIONAL:CAPS"><code class="literal">IDN2_NONTRANSITIONAL</code></a> and the <a class="link" href="libidn2-idn2.h.html#IDN2-NFC-INPUT:CAPS"><code class="literal">IDN2_NFC_INPUT</code></a> flags for compatibility with other software.</p> <div class="refsect3"> <a name="idn2-to-ascii-4z.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>input</p></td> <td class="parameter_description"><p>zero terminated input Unicode (UCS-4) string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>output</p></td> <td class="parameter_description"><p>pointer to newly allocated zero-terminated output string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>optional <a class="link" href="libidn2-idn2.h.html#idn2-flags" title="enum idn2_flags"><span class="type">idn2_flags</span></a> to modify behaviour.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-to-ascii-4z.returns"></a><h4>Returns</h4> <p> Returns <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a> on success, or error code.</p> </div> <p class="since">Since: <a class="link" href="api-index-2.0.0.html" title="Index of new API in 2.0.0">2.0.0</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-to-ascii-8z"></a><h3>idn2_to_ascii_8z ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_to_ascii_8z (<em class="parameter"><code>const <span class="type">char</span> *input</code></em>, <em class="parameter"><code><span class="type">char</span> **output</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Convert UTF-8 domain name to ASCII string using the IDNA2008 rules. The domain name may contain several labels, separated by dots. The output buffer must be deallocated by the caller.</p> <p>The default behavior of this function (when flags are zero) is to apply the IDNA2008 rules without the TR46 amendments. As the TR46 non-transitional processing is nowadays ubiquitous, when unsure, it is recommended to call this function with the <a class="link" href="libidn2-idn2.h.html#IDN2-NONTRANSITIONAL:CAPS"><code class="literal">IDN2_NONTRANSITIONAL</code></a> and the <a class="link" href="libidn2-idn2.h.html#IDN2-NFC-INPUT:CAPS"><code class="literal">IDN2_NFC_INPUT</code></a> flags for compatibility with other software.</p> <div class="refsect3"> <a name="idn2-to-ascii-8z.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>input</p></td> <td class="parameter_description"><p>zero terminated input UTF-8 string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>output</p></td> <td class="parameter_description"><p>pointer to newly allocated output string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>optional <a class="link" href="libidn2-idn2.h.html#idn2-flags" title="enum idn2_flags"><span class="type">idn2_flags</span></a> to modify behaviour.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-to-ascii-8z.returns"></a><h4>Returns</h4> <p> Returns <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a> on success, or error code.</p> </div> <p class="since">Since: <a class="link" href="api-index-2.0.0.html" title="Index of new API in 2.0.0">2.0.0</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-to-ascii-lz"></a><h3>idn2_to_ascii_lz ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_to_ascii_lz (<em class="parameter"><code>const <span class="type">char</span> *input</code></em>, <em class="parameter"><code><span class="type">char</span> **output</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Convert a domain name in locale's encoding to ASCII string using the IDNA2008 rules. The domain name may contain several labels, separated by dots. The output buffer must be deallocated by the caller.</p> <p>The default behavior of this function (when flags are zero) is to apply the IDNA2008 rules without the TR46 amendments. As the TR46 non-transitional processing is nowadays ubiquitous, when unsure, it is recommended to call this function with the <a class="link" href="libidn2-idn2.h.html#IDN2-NONTRANSITIONAL:CAPS"><code class="literal">IDN2_NONTRANSITIONAL</code></a> and the <a class="link" href="libidn2-idn2.h.html#IDN2-NFC-INPUT:CAPS"><code class="literal">IDN2_NFC_INPUT</code></a> flags for compatibility with other software.</p> <div class="refsect3"> <a name="idn2-to-ascii-lz.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>input</p></td> <td class="parameter_description"><p>zero terminated input UTF-8 string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>output</p></td> <td class="parameter_description"><p>pointer to newly allocated output string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>optional <a class="link" href="libidn2-idn2.h.html#idn2-flags" title="enum idn2_flags"><span class="type">idn2_flags</span></a> to modify behaviour.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-to-ascii-lz.returns"></a><h4>Returns</h4> <p> <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a> on success, or error code. Same as described in <a class="link" href="libidn2-idn2.h.html#idn2-lookup-ul" title="idn2_lookup_ul ()"><code class="function">idn2_lookup_ul()</code></a> documentation.</p> </div> <p class="since">Since: <a class="link" href="api-index-2.0.0.html" title="Index of new API in 2.0.0">2.0.0</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-to-unicode-8z4z"></a><h3>idn2_to_unicode_8z4z ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_to_unicode_8z4z (<em class="parameter"><code>const <span class="type">char</span> *input</code></em>, <em class="parameter"><code><span class="type">uint32_t</span> **output</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Converts a possibly ACE encoded domain name in UTF-8 format into a UTF-32 string (punycode decoding). The output buffer will be zero-terminated and must be deallocated by the caller.</p> <p><em class="parameter"><code>output</code></em> may be NULL to test lookup of <em class="parameter"><code>input</code></em> without allocating memory.</p> <div class="refsect3"> <a name="idn2-to-unicode-8z4z.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>input</p></td> <td class="parameter_description"><p>Input zero-terminated UTF-8 string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>output</p></td> <td class="parameter_description"><p>Newly allocated UTF-32/UCS-4 output string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>Currently unused.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-to-unicode-8z4z.returns"></a><h4>Returns</h4> <p> <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a>: The conversion was successful. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-DOMAIN:CAPS"><code class="literal">IDN2_TOO_BIG_DOMAIN</code></a>: The domain is too long. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-LABEL:CAPS"><code class="literal">IDN2_TOO_BIG_LABEL</code></a>: A label is would have been too long. <a class="link" href="libidn2-idn2.h.html#IDN2-ENCODING-ERROR:CAPS"><code class="literal">IDN2_ENCODING_ERROR</code></a>: Character conversion failed. <a class="link" href="libidn2-idn2.h.html#IDN2-MALLOC:CAPS"><code class="literal">IDN2_MALLOC</code></a>: Memory allocation failed.</p> </div> <p class="since">Since: <a class="link" href="api-index-2.0.0.html" title="Index of new API in 2.0.0">2.0.0</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-to-unicode-4z4z"></a><h3>idn2_to_unicode_4z4z ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_to_unicode_4z4z (<em class="parameter"><code>const <span class="type">uint32_t</span> *input</code></em>, <em class="parameter"><code><span class="type">uint32_t</span> **output</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Converts a possibly ACE encoded domain name in UTF-32 format into a UTF-32 string (punycode decoding). The output buffer will be zero-terminated and must be deallocated by the caller.</p> <p><em class="parameter"><code>output</code></em> may be NULL to test lookup of <em class="parameter"><code>input</code></em> without allocating memory.</p> <div class="refsect3"> <a name="idn2-to-unicode-4z4z.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>input</p></td> <td class="parameter_description"><p>Input zero-terminated UTF-32 string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>output</p></td> <td class="parameter_description"><p>Newly allocated UTF-32 output string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>Currently unused.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-to-unicode-4z4z.returns"></a><h4>Returns</h4> <p> <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a>: The conversion was successful. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-DOMAIN:CAPS"><code class="literal">IDN2_TOO_BIG_DOMAIN</code></a>: The domain is too long. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-LABEL:CAPS"><code class="literal">IDN2_TOO_BIG_LABEL</code></a>: A label is would have been too long. <a class="link" href="libidn2-idn2.h.html#IDN2-ENCODING-ERROR:CAPS"><code class="literal">IDN2_ENCODING_ERROR</code></a>: Character conversion failed. <a class="link" href="libidn2-idn2.h.html#IDN2-MALLOC:CAPS"><code class="literal">IDN2_MALLOC</code></a>: Memory allocation failed.</p> </div> <p class="since">Since: <a class="link" href="api-index-2.0.0.html" title="Index of new API in 2.0.0">2.0.0</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-to-unicode-44i"></a><h3>idn2_to_unicode_44i ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_to_unicode_44i (<em class="parameter"><code>const <span class="type">uint32_t</span> *in</code></em>, <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>, <em class="parameter"><code><span class="type">uint32_t</span> *out</code></em>, <em class="parameter"><code><span class="type">size_t</span> *outlen</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>The ToUnicode operation takes a sequence of UTF-32 code points that make up one domain label and returns a sequence of UTF-32 code points. If the input sequence is a label in ACE form, then the result is an equivalent internationalized label that is not in ACE form, otherwise the original sequence is returned unaltered.</p> <p><em class="parameter"><code>output</code></em> may be NULL to test lookup of <em class="parameter"><code>input</code></em> without allocating memory.</p> <div class="refsect3"> <a name="idn2-to-unicode-44i.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>in</p></td> <td class="parameter_description"><p>Input array with UTF-32 code points.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>inlen</p></td> <td class="parameter_description"><p>number of code points of input array</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>out</p></td> <td class="parameter_description"><p>output array with UTF-32 code points.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>outlen</p></td> <td class="parameter_description"><p>on input, maximum size of output array with UTF-32 code points, on exit, actual size of output array with UTF-32 code points.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>Currently unused.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-to-unicode-44i.returns"></a><h4>Returns</h4> <p> <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a>: The conversion was successful. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-DOMAIN:CAPS"><code class="literal">IDN2_TOO_BIG_DOMAIN</code></a>: The domain is too long. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-LABEL:CAPS"><code class="literal">IDN2_TOO_BIG_LABEL</code></a>: A label is would have been too long. <a class="link" href="libidn2-idn2.h.html#IDN2-ENCODING-ERROR:CAPS"><code class="literal">IDN2_ENCODING_ERROR</code></a>: Character conversion failed. <a class="link" href="libidn2-idn2.h.html#IDN2-MALLOC:CAPS"><code class="literal">IDN2_MALLOC</code></a>: Memory allocation failed.</p> </div> <p class="since">Since: <a class="link" href="api-index-2.0.0.html" title="Index of new API in 2.0.0">2.0.0</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-to-unicode-8z8z"></a><h3>idn2_to_unicode_8z8z ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_to_unicode_8z8z (<em class="parameter"><code>const <span class="type">char</span> *input</code></em>, <em class="parameter"><code><span class="type">char</span> **output</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Converts a possibly ACE encoded domain name in UTF-8 format into a UTF-8 string (punycode decoding). The output buffer will be zero-terminated and must be deallocated by the caller.</p> <p><em class="parameter"><code>output</code></em> may be NULL to test lookup of <em class="parameter"><code>input</code></em> without allocating memory.</p> <div class="refsect3"> <a name="idn2-to-unicode-8z8z.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>input</p></td> <td class="parameter_description"><p>Input zero-terminated UTF-8 string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>output</p></td> <td class="parameter_description"><p>Newly allocated UTF-8 output string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>Currently unused.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-to-unicode-8z8z.returns"></a><h4>Returns</h4> <p> <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a>: The conversion was successful. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-DOMAIN:CAPS"><code class="literal">IDN2_TOO_BIG_DOMAIN</code></a>: The domain is too long. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-LABEL:CAPS"><code class="literal">IDN2_TOO_BIG_LABEL</code></a>: A label is would have been too long. <a class="link" href="libidn2-idn2.h.html#IDN2-ENCODING-ERROR:CAPS"><code class="literal">IDN2_ENCODING_ERROR</code></a>: Character conversion failed. <a class="link" href="libidn2-idn2.h.html#IDN2-MALLOC:CAPS"><code class="literal">IDN2_MALLOC</code></a>: Memory allocation failed.</p> </div> <p class="since">Since: <a class="link" href="api-index-2.0.0.html" title="Index of new API in 2.0.0">2.0.0</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-to-unicode-8zlz"></a><h3>idn2_to_unicode_8zlz ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_to_unicode_8zlz (<em class="parameter"><code>const <span class="type">char</span> *input</code></em>, <em class="parameter"><code><span class="type">char</span> **output</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Converts a possibly ACE encoded domain name in UTF-8 format into a string encoded in the current locale's character set (punycode decoding). The output buffer will be zero-terminated and must be deallocated by the caller.</p> <p><em class="parameter"><code>output</code></em> may be NULL to test lookup of <em class="parameter"><code>input</code></em> without allocating memory.</p> <div class="refsect3"> <a name="idn2-to-unicode-8zlz.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>input</p></td> <td class="parameter_description"><p>Input zero-terminated UTF-8 string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>output</p></td> <td class="parameter_description"><p>Newly allocated output string in current locale's character set.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>Currently unused.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-to-unicode-8zlz.returns"></a><h4>Returns</h4> <p> <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a>: The conversion was successful. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-DOMAIN:CAPS"><code class="literal">IDN2_TOO_BIG_DOMAIN</code></a>: The domain is too long. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-LABEL:CAPS"><code class="literal">IDN2_TOO_BIG_LABEL</code></a>: A label is would have been too long. <a class="link" href="libidn2-idn2.h.html#IDN2-ENCODING-ERROR:CAPS"><code class="literal">IDN2_ENCODING_ERROR</code></a>: Character conversion failed. <a class="link" href="libidn2-idn2.h.html#IDN2-MALLOC:CAPS"><code class="literal">IDN2_MALLOC</code></a>: Memory allocation failed.</p> </div> <p class="since">Since: <a class="link" href="api-index-2.0.0.html" title="Index of new API in 2.0.0">2.0.0</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-to-unicode-lzlz"></a><h3>idn2_to_unicode_lzlz ()</h3> <pre class="programlisting"><span class="returnvalue">int</span> idn2_to_unicode_lzlz (<em class="parameter"><code>const <span class="type">char</span> *input</code></em>, <em class="parameter"><code><span class="type">char</span> **output</code></em>, <em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre> <p>Converts a possibly ACE encoded domain name in the locale's character set into a string encoded in the current locale's character set (punycode decoding). The output buffer will be zero-terminated and must be deallocated by the caller.</p> <p><em class="parameter"><code>output</code></em> may be NULL to test lookup of <em class="parameter"><code>input</code></em> without allocating memory.</p> <div class="refsect3"> <a name="idn2-to-unicode-lzlz.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>input</p></td> <td class="parameter_description"><p>Input zero-terminated string encoded in the current locale's character set.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>output</p></td> <td class="parameter_description"><p>Newly allocated output string in current locale's character set.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>Currently unused.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-to-unicode-lzlz.returns"></a><h4>Returns</h4> <p> <a class="link" href="libidn2-idn2.h.html#IDN2-OK:CAPS"><code class="literal">IDN2_OK</code></a>: The conversion was successful. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-DOMAIN:CAPS"><code class="literal">IDN2_TOO_BIG_DOMAIN</code></a>: The domain is too long. <a class="link" href="libidn2-idn2.h.html#IDN2-TOO-BIG-LABEL:CAPS"><code class="literal">IDN2_TOO_BIG_LABEL</code></a>: A label is would have been too long. <a class="link" href="libidn2-idn2.h.html#IDN2-ENCODING-ERROR:CAPS"><code class="literal">IDN2_ENCODING_ERROR</code></a>: Output character conversion failed. <a class="link" href="libidn2-idn2.h.html#IDN2-ICONV-FAIL:CAPS"><code class="literal">IDN2_ICONV_FAIL</code></a>: Input character conversion failed. <a class="link" href="libidn2-idn2.h.html#IDN2-MALLOC:CAPS"><code class="literal">IDN2_MALLOC</code></a>: Memory allocation failed.</p> </div> <p class="since">Since: <a class="link" href="api-index-2.0.0.html" title="Index of new API in 2.0.0">2.0.0</a></p> </div> <hr> <div class="refsect2"> <a name="idn2-strerror"></a><h3>idn2_strerror ()</h3> <pre class="programlisting">const <span class="returnvalue">char</span> * idn2_strerror (<em class="parameter"><code><span class="type">int</span> rc</code></em>);</pre> <p>Convert internal libidn2 error code to a humanly readable string. The returned pointer must not be de-allocated by the caller.</p> <div class="refsect3"> <a name="idn2-strerror.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>rc</p></td> <td class="parameter_description"><p>return code from another libidn2 function.</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-strerror.returns"></a><h4>Returns</h4> <p> A humanly readable string describing error.</p> </div> </div> <hr> <div class="refsect2"> <a name="idn2-strerror-name"></a><h3>idn2_strerror_name ()</h3> <pre class="programlisting">const <span class="returnvalue">char</span> * idn2_strerror_name (<em class="parameter"><code><span class="type">int</span> rc</code></em>);</pre> <p>Convert internal libidn2 error code to a string corresponding to internal header file symbols. For example, idn2_strerror_name(IDN2_MALLOC) will return the string "IDN2_MALLOC".</p> <p>The caller must not attempt to de-allocate the returned string.</p> <div class="refsect3"> <a name="idn2-strerror-name.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>rc</p></td> <td class="parameter_description"><p>return code from another libidn2 function.</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-strerror-name.returns"></a><h4>Returns</h4> <p> A string corresponding to error code symbol.</p> </div> </div> <hr> <div class="refsect2"> <a name="idn2-check-version"></a><h3>idn2_check_version ()</h3> <pre class="programlisting">const <span class="returnvalue">char</span> * idn2_check_version (<em class="parameter"><code>const <span class="type">char</span> *req_version</code></em>);</pre> <p>Check IDN2 library version. This function can also be used to read out the version of the library code used. See <a class="link" href="libidn2-idn2.h.html#IDN2-VERSION:CAPS" title="IDN2_VERSION"><code class="literal">IDN2_VERSION</code></a> for a suitable <em class="parameter"><code>req_version</code></em> string, it corresponds to the idn2.h header file version. Normally these two version numbers match, but if you are using an application built against an older libidn2 with a newer libidn2 shared library they will be different.</p> <div class="refsect3"> <a name="idn2-check-version.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>req_version</p></td> <td class="parameter_description"><p>version string to compare with, or NULL.</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="idn2-check-version.returns"></a><h4>Returns</h4> <p> Check that the version of the library is at minimum the one given as a string in <em class="parameter"><code>req_version</code></em> and return the actual version string of the library; return NULL if the condition is not met. If NULL is passed to this function no check is done and only the version string is returned.</p> </div> </div> <hr> <div class="refsect2"> <a name="idn2-free"></a><h3>idn2_free ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> idn2_free (<em class="parameter"><code><span class="type">void</span> *ptr</code></em>);</pre> <p>Call free(3) on the given pointer.</p> <p>This function is typically only useful on systems where the library malloc heap is different from the library caller malloc heap, which happens on Windows when the library is a separate DLL.</p> <div class="refsect3"> <a name="idn2-free.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>ptr</p></td> <td class="parameter_description"><p>pointer to deallocate</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> </div> </div> <div class="refsect1"> <a name="libidn2-idn2.h.other_details"></a><h2>Types and Values</h2> <div class="refsect2"> <a name="G-GNUC-IDN2-ATTRIBUTE-PURE:CAPS"></a><h3>G_GNUC_IDN2_ATTRIBUTE_PURE</h3> <pre class="programlisting"># define G_GNUC_IDN2_ATTRIBUTE_PURE __attribute__ ((pure)) </pre> <p>Function attribute: Function is a pure function.</p> </div> <hr> <div class="refsect2"> <a name="G-GNUC-IDN2-ATTRIBUTE-CONST:CAPS"></a><h3>G_GNUC_IDN2_ATTRIBUTE_CONST</h3> <pre class="programlisting"># define G_GNUC_IDN2_ATTRIBUTE_CONST __attribute__ ((const)) </pre> <p>Function attribute: Function is a const function.</p> </div> <hr> <div class="refsect2"> <a name="G-GNUC-DEPRECATED:CAPS"></a><h3>G_GNUC_DEPRECATED</h3> <pre class="programlisting"># define G_GNUC_DEPRECATED __attribute__((deprecated)) </pre> <p>Function attribute: Function is deprecated.</p> </div> <hr> <div class="refsect2"> <a name="G-GNUC-UNUSED:CAPS"></a><h3>G_GNUC_UNUSED</h3> <pre class="programlisting"># define G_GNUC_UNUSED __attribute__ ((__unused__)) </pre> <p>Parameter attribute: Parameter is not used.</p> </div> <hr> <div class="refsect2"> <a name="IDN2-VERSION:CAPS"></a><h3>IDN2_VERSION</h3> <pre class="programlisting">#define IDN2_VERSION "2.3.2" </pre> <p>Pre-processor symbol with a string that describe the header file version number. Used together with <a class="link" href="libidn2-idn2.h.html#idn2-check-version" title="idn2_check_version ()"><code class="function">idn2_check_version()</code></a> to verify header file and run-time library consistency.</p> </div> <hr> <div class="refsect2"> <a name="IDN2-VERSION-NUMBER:CAPS"></a><h3>IDN2_VERSION_NUMBER</h3> <pre class="programlisting">#define IDN2_VERSION_NUMBER 0x02030002 </pre> <p>Pre-processor symbol with a hexadecimal value describing the header file version number. For example, when the header version is 1.2.4711 this symbol will have the value 0x01021267. The last four digits are used to enumerate development snapshots, but for all public releases they will be 0000.</p> </div> <hr> <div class="refsect2"> <a name="IDN2-VERSION-MAJOR:CAPS"></a><h3>IDN2_VERSION_MAJOR</h3> <pre class="programlisting">#define IDN2_VERSION_MAJOR 2 </pre> <p>Pre-processor symbol for the major version number (decimal). The version scheme is major.minor.patchlevel.</p> </div> <hr> <div class="refsect2"> <a name="IDN2-VERSION-MINOR:CAPS"></a><h3>IDN2_VERSION_MINOR</h3> <pre class="programlisting">#define IDN2_VERSION_MINOR 3 </pre> <p>Pre-processor symbol for the minor version number (decimal). The version scheme is major.minor.patchlevel.</p> </div> <hr> <div class="refsect2"> <a name="IDN2-VERSION-PATCH:CAPS"></a><h3>IDN2_VERSION_PATCH</h3> <pre class="programlisting">#define IDN2_VERSION_PATCH 2 </pre> <p>Pre-processor symbol for the patch level number (decimal). The version scheme is major.minor.patchlevel.</p> </div> <hr> <div class="refsect2"> <a name="IDN2-LABEL-MAX-LENGTH:CAPS"></a><h3>IDN2_LABEL_MAX_LENGTH</h3> <pre class="programlisting">#define IDN2_LABEL_MAX_LENGTH 63 </pre> <p>Constant specifying the maximum length of a DNS label to 63 characters, as specified in RFC 1034.</p> </div> <hr> <div class="refsect2"> <a name="IDN2-DOMAIN-MAX-LENGTH:CAPS"></a><h3>IDN2_DOMAIN_MAX_LENGTH</h3> <pre class="programlisting">#define IDN2_DOMAIN_MAX_LENGTH 255 </pre> <p>Constant specifying the maximum size of the wire encoding of a DNS domain to 255 characters, as specified in RFC 1034. Note that the usual printed representation of a domain name is limited to 253 characters if it does not end with a period, or 254 characters if it ends with a period.</p> </div> <hr> <div class="refsect2"> <a name="idn2-flags"></a><h3>enum idn2_flags</h3> <p>Flags to IDNA2008 functions, to be binary or:ed together. Specify only 0 if you want the default behaviour.</p> <div class="refsect3"> <a name="idn2-flags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="IDN2-NFC-INPUT:CAPS"></a>IDN2_NFC_INPUT</p></td> <td class="enum_member_description"> <p>Normalize input string using normalization form C.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-ALABEL-ROUNDTRIP:CAPS"></a>IDN2_ALABEL_ROUNDTRIP</p></td> <td class="enum_member_description"> <p>Perform optional IDNA2008 lookup roundtrip check (default).</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-TRANSITIONAL:CAPS"></a>IDN2_TRANSITIONAL</p></td> <td class="enum_member_description"> <p>Perform Unicode TR46 transitional processing.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-NONTRANSITIONAL:CAPS"></a>IDN2_NONTRANSITIONAL</p></td> <td class="enum_member_description"> <p>Perform Unicode TR46 non-transitional processing (default).</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-ALLOW-UNASSIGNED:CAPS"></a>IDN2_ALLOW_UNASSIGNED</p></td> <td class="enum_member_description"> <p>Libidn compatibility flag, unused.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-USE-STD3-ASCII-RULES:CAPS"></a>IDN2_USE_STD3_ASCII_RULES</p></td> <td class="enum_member_description"> <p>Use STD3 ASCII rules. This is a Unicode TR46 only flag, and will be ignored when set without either <em class="parameter"><code>IDN2_TRANSITIONAL</code></em> or <em class="parameter"><code>IDN2_NONTRANSITIONAL</code></em> .</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-NO-TR46:CAPS"></a>IDN2_NO_TR46</p></td> <td class="enum_member_description"> <p>Disable Unicode TR46 processing.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-NO-ALABEL-ROUNDTRIP:CAPS"></a>IDN2_NO_ALABEL_ROUNDTRIP</p></td> <td class="enum_member_description"> <p>Disable ALabel lookup roundtrip check.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="idn2-rc"></a><h3>enum idn2_rc</h3> <p>Return codes for IDN2 functions. All return codes are negative except for the successful code IDN2_OK which are guaranteed to be</p> <div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Positive values are reserved for non-error return codes.</p></li></ol></div> <p>Note that the <a class="link" href="libidn2-idn2.h.html#idn2-rc" title="enum idn2_rc"><span class="type">idn2_rc</span></a> enumeration may be extended at a later date to include new return codes.</p> <div class="refsect3"> <a name="idn2-rc.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="IDN2-OK:CAPS"></a>IDN2_OK</p></td> <td class="enum_member_description"> <p>Successful return.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-MALLOC:CAPS"></a>IDN2_MALLOC</p></td> <td class="enum_member_description"> <p>Memory allocation error.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-NO-CODESET:CAPS"></a>IDN2_NO_CODESET</p></td> <td class="enum_member_description"> <p>Could not determine locale string encoding format.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-ICONV-FAIL:CAPS"></a>IDN2_ICONV_FAIL</p></td> <td class="enum_member_description"> <p>Could not transcode locale string to UTF-8.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-ENCODING-ERROR:CAPS"></a>IDN2_ENCODING_ERROR</p></td> <td class="enum_member_description"> <p>Unicode data encoding error.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-NFC:CAPS"></a>IDN2_NFC</p></td> <td class="enum_member_description"> <p>Error normalizing string.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-PUNYCODE-BAD-INPUT:CAPS"></a>IDN2_PUNYCODE_BAD_INPUT</p></td> <td class="enum_member_description"> <p>Punycode invalid input.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-PUNYCODE-BIG-OUTPUT:CAPS"></a>IDN2_PUNYCODE_BIG_OUTPUT</p></td> <td class="enum_member_description"> <p>Punycode output buffer too small.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-PUNYCODE-OVERFLOW:CAPS"></a>IDN2_PUNYCODE_OVERFLOW</p></td> <td class="enum_member_description"> <p>Punycode conversion would overflow.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-TOO-BIG-DOMAIN:CAPS"></a>IDN2_TOO_BIG_DOMAIN</p></td> <td class="enum_member_description"> <p>Domain name longer than 255 characters.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-TOO-BIG-LABEL:CAPS"></a>IDN2_TOO_BIG_LABEL</p></td> <td class="enum_member_description"> <p>Domain label longer than 63 characters.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-INVALID-ALABEL:CAPS"></a>IDN2_INVALID_ALABEL</p></td> <td class="enum_member_description"> <p>Input A-label is not valid.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-UALABEL-MISMATCH:CAPS"></a>IDN2_UALABEL_MISMATCH</p></td> <td class="enum_member_description"> <p>Input A-label and U-label does not match.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-INVALID-FLAGS:CAPS"></a>IDN2_INVALID_FLAGS</p></td> <td class="enum_member_description"> <p>Invalid combination of flags.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-NOT-NFC:CAPS"></a>IDN2_NOT_NFC</p></td> <td class="enum_member_description"> <p>String is not NFC.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-2HYPHEN:CAPS"></a>IDN2_2HYPHEN</p></td> <td class="enum_member_description"> <p>String has forbidden two hyphens.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-HYPHEN-STARTEND:CAPS"></a>IDN2_HYPHEN_STARTEND</p></td> <td class="enum_member_description"> <p>String has forbidden starting/ending hyphen.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-LEADING-COMBINING:CAPS"></a>IDN2_LEADING_COMBINING</p></td> <td class="enum_member_description"> <p>String has forbidden leading combining character.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-DISALLOWED:CAPS"></a>IDN2_DISALLOWED</p></td> <td class="enum_member_description"> <p>String has disallowed character.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-CONTEXTJ:CAPS"></a>IDN2_CONTEXTJ</p></td> <td class="enum_member_description"> <p>String has forbidden context-j character.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-CONTEXTJ-NO-RULE:CAPS"></a>IDN2_CONTEXTJ_NO_RULE</p></td> <td class="enum_member_description"> <p>String has context-j character with no rull.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-CONTEXTO:CAPS"></a>IDN2_CONTEXTO</p></td> <td class="enum_member_description"> <p>String has forbidden context-o character.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-CONTEXTO-NO-RULE:CAPS"></a>IDN2_CONTEXTO_NO_RULE</p></td> <td class="enum_member_description"> <p>String has context-o character with no rull.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-UNASSIGNED:CAPS"></a>IDN2_UNASSIGNED</p></td> <td class="enum_member_description"> <p>String has forbidden unassigned character.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-BIDI:CAPS"></a>IDN2_BIDI</p></td> <td class="enum_member_description"> <p>String has forbidden bi-directional properties.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-DOT-IN-LABEL:CAPS"></a>IDN2_DOT_IN_LABEL</p></td> <td class="enum_member_description"> <p>Label has forbidden dot (TR46).</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-INVALID-TRANSITIONAL:CAPS"></a>IDN2_INVALID_TRANSITIONAL</p></td> <td class="enum_member_description"> <p>Label has character forbidden in transitional mode (TR46).</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-INVALID-NONTRANSITIONAL:CAPS"></a>IDN2_INVALID_NONTRANSITIONAL</p></td> <td class="enum_member_description"> <p>Label has character forbidden in non-transitional mode (TR46).</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="IDN2-ALABEL-ROUNDTRIP-FAILED:CAPS"></a>IDN2_ALABEL_ROUNDTRIP_FAILED</p></td> <td class="enum_member_description"> <p>ALabel -> Ulabel -> ALabel result differs from input.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.33.1</div> </body> </html>