Classes

Exceptions

Functions

Class idna_convert

Encode/decode Internationalized Domain Names.

The class allows to convert internationalized domain names (see RFC 3490 for
details) as they can be used with various registries worldwide to be translated
between their original (localized) form and their encoded form as it will be
used in the DNS (Domain Name System).

The class provides two public methods, encode() and decode(), which do
exactly what you would expect them to do. You are allowed to use complete domain
names, simple strings and complete email addresses as well. That means, that you
might use any of the following notations:

Parameters

Since

Sets a new option value. Available options and values: [encoding - Use either
UTF-8, UCS4 as array or UCS4 as string as input ('utf8' for UTF-8,
'ucs4_string' and 'ucs4_array' respectively for UCS4); The output is always
UTF-8] [overlong - Unicode does not allow unnecessarily long encodings of
chars,
to allow this, set this parameter to true, else to false;
default is false.] [strict - true: strict mode, good for registration purposes -
Causes errors
on failures; false: loose mode, ideal for "wildlife" applications
by silently ignoring errors and returning the original input instead

Sets a new option value. Available options and values: [encoding - Use either
UTF-8, UCS4 as array or UCS4 as string as input ('utf8' for UTF-8, 'ucs4_string'
and 'ucs4_array' respectively for UCS4); The output is always UTF-8] [overlong -
Unicode does not allow unnecessarily long encodings of chars, to allow this, set
this parameter to true, else to false; default is false.] [strict - true: strict
mode, good for registration purposes - Causes errors on failures; false: loose
mode, ideal for "wildlife" applications by silently ignoring errors and
returning the original input instead

Parameters

$option

mixedParameter to set (string: single parameter; array of Parameter => Value
pairs)

Parameters

Returns

This converts an UTF-8 encoded string to its UCS-4 representation By talking
about UCS-4 "strings" we mean arrays of 32bit integers representing each of the
"chars". This is due to PHP not being able to handle strings with bit depth
different from 8. This apllies to the reverse method _ucs4_to_utf8(), too. The
following UTF-8 encodings are supported: bytes bits representation 1 7 0xxxxxxx
2 11 110xxxxx 10xxxxxx 3 16 1110xxxx 10xxxxxx 10xxxxxx 4 21 11110xxx 10xxxxxx
10xxxxxx 10xxxxxx 5 26 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 6 31
1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx Each x represents a bit
that can be used to store character data. The five and six byte sequences are
part of Annex D of ISO/IEC 10646-1:2000

This converts an UTF-8 encoded string to its UCS-4 representation By talking
about UCS-4 "strings" we mean arrays of 32bit integers representing each of the
"chars". This is due to PHP not being able to handle strings with bit depth
different from 8. This apllies to the reverse method _ucs4_to_utf8(), too. The
following UTF-8 encodings are supported: bytes bits representation 1 7 0xxxxxxx
2 11 110xxxxx 10xxxxxx 3 16 1110xxxx 10xxxxxx 10xxxxxx 4 21 11110xxx 10xxxxxx
10xxxxxx 10xxxxxx 5 26 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 6 31
1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx Each x represents a bit
that can be used to store character data. The five and six byte sequences are
part of Annex D of ISO/IEC 10646-1:2000