- Documentationof recent IDNA changes in intl.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@320929 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Gustavo André dos Santos Lopes 2011-12-12 20:15:26 +00:00
parent 6d3d2c2e91
commit 3dd55b3d41
3 changed files with 238 additions and 9 deletions

View file

@ -51,6 +51,129 @@
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>IDNA_CHECK_BIDI</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Check whether the input conforms to the BiDi rules.
Ignored by the IDNA2003 implementation, which always performs this check.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>IDNA_CHECK_CONTEXTJ</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Check whether the input conforms to the CONTEXTJ rules.
Ignored by the IDNA2003 implementation, as this check is new in IDNA2008.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>IDNA_NONTRANSITIONAL_TO_ASCII</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Option for nontransitional processing in
<function>idn_to_ascii</function>. Transitional processing is activated
by default. This option is ignored by the IDNA2003 implementation.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>IDNA_NONTRANSITIONAL_TO_UNICODE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Option for nontransitional processing in
<function>idn_to_utf8</function>. Transitional processing is activated
by default. This option is ignored by the IDNA2003 implementation.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>INTL_IDNA_VARIANT_2003</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Use IDNA 2003 algorithm in <function>idn_to_utf8</function> and
<function>idn_to_ascii</function>. This is the default.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>INTL_IDNA_VARIANT_UTS46</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Use UTS #46 algorithm in <function>idn_to_utf8</function> and
<function>idn_to_ascii</function>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>IDNA_ERROR_EMPTY_LABEL</constant> (<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_LABEL_TOO_LONG</constant> (<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_DOMAIN_NAME_TOO_LONG</constant> (<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_LEADING_HYPHEN</constant> (<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_TRAILING_HYPHEN</constant> (<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_HYPHEN_3_4</constant> (<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_LEADING_COMBINING_MARK</constant>
(<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_DISALLOWED</constant> (<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_PUNYCODE</constant> (<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_LABEL_HAS_DOT</constant> (<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_INVALID_ACE_LABEL</constant> (<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_BIDI</constant> (<type>integer</type>)
</term>
<term>
<constant>IDNA_ERROR_CONTEXTJ</constant> (<type>integer</type>)
</term>
<listitem>
<simpara>
Errors reported in a bitset returned by the UTS #46 algorithm in
<function>idn_to_utf8</function> and
<function>idn_to_ascii</function>.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
</appendix>

View file

@ -11,7 +11,9 @@
<methodsynopsis>
<type>string</type><methodname>idn_to_ascii</methodname>
<methodparam><type>string</type><parameter>domain</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>variant</parameter><initializer>INTL_IDNA_VARIANT_2003</initializer></methodparam>
<methodparam choice="opt"><type>array</type><parameter role="reference">idna_info</parameter></methodparam>
</methodsynopsis>
<para>
This function converts Unicode domain name to IDNA ASCII-compatible format.
@ -34,14 +36,40 @@
<term><parameter>options</parameter></term>
<listitem>
<para>
Conversion options - combination of IDNA_* constants.
Conversion options - combination of IDNA_* constants
(except IDNA_ERROR_* constants).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>variant</parameter></term>
<listitem>
<para>
Either <constant>INTL_IDNA_VARIANT_2003</constant> for IDNA 2003 or
<constant>INTL_IDNA_VARIANT_UTS46</constant> for UTS #46.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>idna_info</parameter></term>
<listitem>
<para>
This parameter can be used only if
<constant>INTL_IDNA_VARIANT_UTS46</constant> was used for
<parameter>variant</parameter>. In that case, it will be filled with an
array with the keys <literal>'result'</literal>, the possibly illegal
result of the transformation,
<literal>'isTransitionalDifferent'</literal>, a boolean indicating
whether the usage of the transitional mechanisms of UTS #46 either has
or would have changed the result and <literal>'errors'</literal>,
which is an <type>int</type> representing a bitset of the error
constants IDNA_ERROR_*.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
@ -49,6 +77,31 @@
Domain name encoded in ASCII-compatible form. &return.falseforfailure;
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.4.0/PECL 2.0.0b1</entry>
<entry>
Added the parameters <parameter>variant</parameter> and
<parameter>idna_info</parameter>; UTS #46 support.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;

View file

@ -11,10 +11,12 @@
<methodsynopsis>
<type>string</type><methodname>idn_to_utf8</methodname>
<methodparam><type>string</type><parameter>domain</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>variant</parameter><initializer>INTL_IDNA_VARIANT_2003</initializer></methodparam>
<methodparam choice="opt"><type>array</type><parameter role="reference">idna_info</parameter></methodparam>
</methodsynopsis>
<para>
This function converts Unicode domain name from IDNA ASCII-compatible format to plain Unicode.
This function converts Unicode domain name from IDNA ASCII-compatible format to plain Unicode, encoded in UTF-8.
</para>
</refsect1>
@ -34,19 +36,70 @@
<term><parameter>options</parameter></term>
<listitem>
<para>
Conversion options - combination of IDNA_* constants.
Conversion options - combination of IDNA_* constants
(except IDNA_ERROR_* constants).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>variant</parameter></term>
<listitem>
<para>
Either <constant>INTL_IDNA_VARIANT_2003</constant> for IDNA 2003 or
<constant>INTL_IDNA_VARIANT_UTS46</constant> for UTS #46.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>idna_info</parameter></term>
<listitem>
<para>
This parameter can be used only if
<constant>INTL_IDNA_VARIANT_UTS46</constant> was used for
<parameter>variant</parameter>. In that case, it will be filled with an
array with the keys <literal>'result'</literal>, the possibly illegal
result of the transformation,
<literal>'isTransitionalDifferent'</literal>, a boolean indicating
whether the usage of the transitional mechanisms of UTS #46 either has
or would have changed the result and <literal>'errors'</literal>,
which is an <type>int</type> representing a bitset of the error
constants IDNA_ERROR_*.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Domain name in Unicode. In PHP 5, domain name will be in UTF-8. &return.falseforfailure;
Domain name in Unicode, encoded in UTF-8. &return.falseforfailure;
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.4.0/PECL 2.0.0b1</entry>
<entry>
Added the parameters <parameter>variant</parameter> and
<parameter>idna_info</parameter>; UTS #46 support.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>