Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe idna_convert
+ Graphe d'héritage de idna_convert:

Fonctions membres publiques

 __construct ($options=false)
 
 set_parameter ($option, $value=false)
 
 decode ($input, $one_time_encoding=false)
 
 encode ($decoded, $one_time_encoding=false)
 
 encode_uri ($uri)
 
 get_last_error ()
 
 getInstance ($params=array())
 
 singleton ($params=array())
 
 idna_convert ($options=false)
 
 set_parameter ($option, $value=false)
 
 decode ($input, $one_time_encoding=false)
 
 encode ($decoded, $one_time_encoding=false)
 
 get_last_error ()
 
 _decode ($encoded)
 
 _encode ($decoded)
 
 _adapt ($delta, $npoints, $is_first)
 
 _encode_digit ($d)
 
 _decode_digit ($cp)
 
 _error ($error='')
 
 _nameprep ($input)
 
 _hangul_decompose ($char)
 
 _hangul_compose ($input)
 
 _get_combining_class ($char)
 
 _apply_cannonical_ordering ($input)
 
 _combine ($input)
 
 _utf8_to_ucs4 ($input)
 
 _ucs4_to_utf8 ($input)
 
 _ucs4_to_ucs4_string ($input)
 
 _ucs4_string_to_ucs4 ($input)
 

Champs de données

 $NP = array()
 

Fonctions membres protégées

 _decode ($encoded)
 
 _encode ($decoded)
 
 _adapt ($delta, $npoints, $is_first)
 
 _encode_digit ($d)
 
 _decode_digit ($cp)
 
 _error ($error='')
 
 _nameprep ($input)
 
 _hangul_decompose ($char)
 
 _hangul_compose ($input)
 
 _get_combining_class ($char)
 
 _apply_cannonical_ordering ($input)
 
 _combine ($input)
 
 _utf8_to_ucs4 ($input)
 
 _ucs4_to_utf8 ($input)
 
 _ucs4_to_ucs4_string ($input)
 
 _ucs4_string_to_ucs4 ($input)
 

Fonctions membres protégées statiques

static byteLength ($string)
 

Attributs protégés

 $_punycode_prefix = 'xn--'
 
 $_invalid_ucs = 0x80000000
 
 $_max_ucs = 0x10FFFF
 
 $_base = 36
 
 $_tmin = 1
 
 $_tmax = 26
 
 $_skew = 38
 
 $_damp = 700
 
 $_initial_bias = 72
 
 $_initial_n = 0x80
 
 $_sbase = 0xAC00
 
 $_lbase = 0x1100
 
 $_vbase = 0x1161
 
 $_tbase = 0x11A7
 
 $_lcount = 19
 
 $_vcount = 21
 
 $_tcount = 28
 
 $_ncount = 588
 
 $_scount = 11172
 
 $_error = false
 
 $_api_encoding = 'utf8'
 
 $_allow_overlong = false
 
 $_strict_mode = false
 
 $_idn_version = 2003
 

Attributs protégés statiques

static $_mb_string_overload = null
 
static $NP
 

Description détaillée

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:

  • www.nörgler.com
  • xn–nrgler-wxa
  • xn–brse-5qa.xn–knrz-1ra.info

Unicode input might be given as either UTF-8 string, UCS-4 string or UCS-4 array. Unicode output is available in the same formats. You can select your preferred format via set_paramter().

ACE input and output is always expected to be ASCII.

Auteur
Matthias Sommerfeld mso@p.nosp@m.hlyl.nosp@m.abs.d.nosp@m.e
Version
0.8.0 2011-03-11
Note
This file has been modified by the Joomla! Project and no longer reflects the original work of its author.

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:

  • www.nörgler.com
  • xn–nrgler-wxa
  • xn–brse-5qa.xn–knrz-1ra.info

Unicode input might be given as either UTF-8 string, UCS-4 string or UCS-4 array. Unicode output is available in the same formats. You can select your preferred format via set_paramter().

ACE input and output is always expected to be ASCII.

Auteur
Matthias Sommerfeld mso@p.nosp@m.hlyl.nosp@m.abs.d.nosp@m.e
Version
0.5.1

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $options = false)

the constructor

Paramètres
array$options
Renvoie
boolean
Depuis
0.5.2

Références $_tcount, $options, null, et set_parameter().

Documentation des fonctions membres

◆ _adapt() [1/2]

_adapt (   $delta,
  $npoints,
  $is_first 
)

Adapt the bias according to the current code point and position private

Références $_base, et $_tmin.

◆ _adapt() [2/2]

_adapt (   $delta,
  $npoints,
  $is_first 
)
protected

Adapt the bias according to the current code point and position

Paramètres
int$delta
int$npoints
int$is_first
Renvoie
int

Références $_base, et $_tmin.

Référencé par _decode(), et _encode().

◆ _apply_cannonical_ordering() [1/2]

_apply_cannonical_ordering (   $input)

Apllies the cannonical ordering of a decomposed UCS4 sequence

Paramètres
arrayDecomposed UCS4 sequence
Renvoie
array Ordered USC4 sequence private

Références $i, $input, et _get_combining_class().

◆ _apply_cannonical_ordering() [2/2]

_apply_cannonical_ordering (   $input)
protected

Applies the cannonical ordering of a decomposed UCS4 sequence

Paramètres
arrayDecomposed UCS4 sequence
Renvoie
array Ordered USC4 sequence

Références $i, $input, et _get_combining_class().

Référencé par _nameprep().

◆ _combine() [1/2]

_combine (   $input)

Do composition of a sequence of starter and non-starter

Paramètres
arrayUCS4 Decomposed sequence
Renvoie
array Ordered USC4 sequence private

Références $input.

◆ _combine() [2/2]

_combine (   $input)
protected

Do composition of a sequence of starter and non-starter

Paramètres
arrayUCS4 Decomposed sequence
Renvoie
array Ordered USC4 sequence

Références $input.

Référencé par _nameprep().

◆ _decode() [1/2]

_decode (   $encoded)

The actual decoding algorithm private

Références $_base, $_initial_bias, $_initial_n, $i, _adapt(), _decode_digit(), _error(), et _ucs4_to_utf8().

◆ _decode() [2/2]

_decode (   $encoded)
protected

The actual decoding algorithm

Paramètres
string
Renvoie
mixed

Références $_base, $_initial_bias, $_initial_n, $i, _adapt(), _decode_digit(), _error(), et _ucs4_to_utf8().

Référencé par decode().

◆ _decode_digit() [1/2]

_decode_digit (   $cp)

Decode a certain digit private

Références $_base.

◆ _decode_digit() [2/2]

_decode_digit (   $cp)
protected

Decode a certain digit

Paramètres
int$cp
Renvoie
int

Références $_base.

Référencé par _decode().

◆ _encode() [1/2]

_encode (   $decoded)

The actual encoding algorithm private

Références $_base, $_initial_bias, $_initial_n, $i, _adapt(), _encode_digit(), _error(), _nameprep(), _utf8_to_ucs4(), et elseif.

◆ _encode() [2/2]

_encode (   $decoded)
protected

The actual encoding algorithm

Paramètres
string
Renvoie
mixed

Références $_base, $_initial_bias, $_initial_n, $i, _adapt(), _encode_digit(), _error(), _nameprep(), _utf8_to_ucs4(), et elseif.

Référencé par encode().

◆ _encode_digit() [1/2]

_encode_digit (   $d)

Encoding a certain digit private

◆ _encode_digit() [2/2]

_encode_digit (   $d)
protected

Encoding a certain digit

Paramètres
int$d
Renvoie
string

Référencé par _encode().

◆ _error() [1/2]

_error (   $error = '')

Internal error handling method private

Références _error().

◆ _error() [2/2]

_error (   $error = '')
protected

Internal error handling method

Paramètres
string$error

Référencé par _decode(), _encode(), _error(), _nameprep(), _ucs4_string_to_ucs4(), _ucs4_to_utf8(), _utf8_to_ucs4(), decode(), encode(), encode_uri(), et set_parameter().

◆ _get_combining_class() [1/2]

_get_combining_class (   $char)

Returns the combining class of a certain wide char

Paramètres
integerWide char to check (32bit integer)
Renvoie
integer Combining class if found, else 0 private

◆ _get_combining_class() [2/2]

_get_combining_class (   $char)
protected

Returns the combining class of a certain wide char

Paramètres
integerWide char to check (32bit integer)
Renvoie
integer Combining class if found, else 0

Référencé par _apply_cannonical_ordering(), et _nameprep().

◆ _hangul_compose() [1/2]

_hangul_compose (   $input)

Ccomposes a Hangul syllable (see http://www.unicode.org/unicode/reports/tr15/#Hangul

Paramètres
arrayDecomposed UCS4 sequence
Renvoie
array UCS4 sequence with syllables composed private

Références $_lbase, $_sbase, $_tbase, $_tcount, $_vbase, $i, et $input.

◆ _hangul_compose() [2/2]

_hangul_compose (   $input)
protected

Ccomposes a Hangul syllable (see http://www.unicode.org/unicode/reports/tr15/#Hangul

Paramètres
arrayDecomposed UCS4 sequence
Renvoie
array UCS4 sequence with syllables composed

Références $_lbase, $_sbase, $_tbase, $_tcount, $_vbase, $i, et $input.

Référencé par _nameprep().

◆ _hangul_decompose() [1/2]

_hangul_decompose (   $char)

Decomposes a Hangul syllable (see http://www.unicode.org/unicode/reports/tr15/#Hangul

Paramètres
integer32bit UCS4 code point
Renvoie
array Either Hangul Syllable decomposed or original 32bit value as one value array private

Références $_tcount.

◆ _hangul_decompose() [2/2]

_hangul_decompose (   $char)
protected

Decomposes a Hangul syllable (see http://www.unicode.org/unicode/reports/tr15/#Hangul

Paramètres
integer32bit UCS4 code point
Renvoie
array Either Hangul Syllable decomposed or original 32bit value as one value array

Références $_tcount.

Référencé par _nameprep().

◆ _nameprep() [1/2]

_nameprep (   $input)

Do Nameprep according to RFC3491 and RFC3454

Paramètres
arrayUnicode Characters
Renvoie
string Unicode Characters, Nameprep'd private

Références $class, $i, $input, $output, $range, _apply_cannonical_ordering(), _combine(), _error(), _get_combining_class(), _hangul_compose(), _hangul_decompose(), et elseif.

◆ _nameprep() [2/2]

_nameprep (   $input)
protected

Do Nameprep according to RFC3491 and RFC3454

Paramètres
arrayUnicode Characters
Renvoie
string Unicode Characters, Nameprep'd

Références $class, $i, $input, $output, $range, _apply_cannonical_ordering(), _combine(), _error(), _get_combining_class(), _hangul_compose(), _hangul_decompose(), et elseif.

Référencé par _encode().

◆ _ucs4_string_to_ucs4() [1/2]

_ucs4_string_to_ucs4 (   $input)

Convert UCS-4 strin into UCS-4 garray

private

Références $i, $input, $output, et _error().

◆ _ucs4_string_to_ucs4() [2/2]

_ucs4_string_to_ucs4 (   $input)
protected

Convert UCS-4 strin into UCS-4 garray

Paramètres
string$input
Renvoie
array

Références $i, $input, $output, et _error().

Référencé par encode().

◆ _ucs4_to_ucs4_string() [1/2]

_ucs4_to_ucs4_string (   $input)

Convert UCS-4 array into UCS-4 string

private

Références $input, et $output.

◆ _ucs4_to_ucs4_string() [2/2]

_ucs4_to_ucs4_string (   $input)
protected

Convert UCS-4 array into UCS-4 string

Paramètres
array$input
Renvoie
string

Références $input, et $output.

Référencé par decode().

◆ _ucs4_to_utf8() [1/2]

_ucs4_to_utf8 (   $input)

Convert UCS-4 string into UTF-8 string See _utf8_to_ucs4() for details private

Références $input, $output, _error(), et elseif.

◆ _ucs4_to_utf8() [2/2]

_ucs4_to_utf8 (   $input)
protected

Convert UCS-4 string into UTF-8 string See _utf8_to_ucs4() for details

Paramètres
string$input
Renvoie
string

Références $input, $output, _error(), et elseif.

Référencé par _decode(), et encode().

◆ _utf8_to_ucs4() [1/2]

_utf8_to_ucs4 (   $input)

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 private

Références $input, $mode, $output, _error(), et elseif.

◆ _utf8_to_ucs4() [2/2]

_utf8_to_ucs4 (   $input)
protected

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

Paramètres
string$input
Renvoie
string

Références $input, $mode, $output, _error(), et elseif.

Référencé par _encode(), decode(), et encode().

◆ byteLength()

static byteLength (   $string)
staticprotected

Gets the length of a string in bytes even if mbstring function overloading is turned on

Paramètres
string$stringthe string for which to get the length.
Renvoie
integer the length of the string in bytes.

◆ decode() [1/2]

decode (   $input,
  $one_time_encoding = false 
)

Decode a given ACE domain name

Paramètres
stringDomain name (ACE string) [
stringDesired output encoding, see set_parameter]
Renvoie
string Decoded Domain name (UTF-8 or UCS-4) public

Références $input, $return, _decode(), _error(), _ucs4_to_ucs4_string(), _utf8_to_ucs4(), et elseif.

◆ decode() [2/2]

decode (   $input,
  $one_time_encoding = false 
)

Decode a given ACE domain name

Paramètres
stringDomain name (ACE string) [
stringDesired output encoding, see set_parameter]
Renvoie
string Decoded Domain name (UTF-8 or UCS-4)

Références $input, $return, _decode(), _error(), _ucs4_to_ucs4_string(), _utf8_to_ucs4(), et elseif.

◆ encode() [1/2]

encode (   $decoded,
  $one_time_encoding = false 
)

Encode a given UTF-8 domain name

Paramètres
stringDomain name (UTF-8 or UCS-4) [
stringDesired input encoding, see set_parameter]
Renvoie
string Encoded Domain name (ACE string) public

Références $output, _encode(), _error(), _ucs4_string_to_ucs4(), _ucs4_to_utf8(), et _utf8_to_ucs4().

◆ encode() [2/2]

encode (   $decoded,
  $one_time_encoding = false 
)

Encode a given UTF-8 domain name

Paramètres
stringDomain name (UTF-8 or UCS-4) [
stringDesired input encoding, see set_parameter]
Renvoie
string Encoded Domain name (ACE string)

Références $output, _encode(), _error(), _ucs4_string_to_ucs4(), _ucs4_to_utf8(), et _utf8_to_ucs4().

Référencé par encode_uri().

◆ encode_uri()

encode_uri (   $uri)

Removes a weakness of encode(), which cannot properly handle URIs but instead encodes their path or query components, too.

Paramètres
string$uriExpects the URI as a UTF-8 (or ASCII) string
Renvoie
string The URI encoded to Punycode, everything but the host component is left alone
Depuis
0.6.4

Références $return, $uri, _error(), et encode().

◆ get_last_error() [1/2]

get_last_error ( )

Use this method to get the last error ocurred

Paramètres
void
Renvoie
string The last error, that occured public

Références $_error.

◆ get_last_error() [2/2]

get_last_error ( )

Use this method to get the last error ocurred

Paramètres
void
Renvoie
string The last error, that occured

Références $_error.

◆ getInstance()

getInstance (   $params = array())

Attempts to return a concrete IDNA instance.

Paramètres
array$paramsSet of paramaters
Renvoie
idna_convert public

Références $params, et idna_convert().

Référencé par singleton().

◆ idna_convert()

idna_convert (   $options = false)

Références $_tcount, $options, et set_parameter().

Référencé par getInstance().

◆ set_parameter() [1/2]

set_parameter (   $option,
  $value = false 
)

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

Paramètres
mixedParameter to set (string: single parameter; array of Parameter => Value pairs)
stringValue to use (if parameter 1 is a string)
Renvoie
boolean true on success, false otherwise public

Références $option, $value, et _error().

◆ set_parameter() [2/2]

set_parameter (   $option,
  $value = false 
)

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

Paramètres
mixedParameter to set (string: single parameter; array of Parameter => Value pairs)
stringValue to use (if parameter 1 is a string)
Renvoie
boolean true on success, false otherwise

Références $option, $value, et _error().

Référencé par __construct(), et idna_convert().

◆ singleton()

singleton (   $params = array())

Attempts to return a concrete IDNA instance for either php4 or php5, only creating a new instance if no IDNA instance with the same parameters currently exists.

Paramètres
array$paramsSet of paramaters
Renvoie
object idna_convert public

Références $params, et getInstance().

Documentation des champs

◆ $_allow_overlong

$_allow_overlong = false
protected

◆ $_api_encoding

$_api_encoding = 'utf8'
protected

◆ $_base

$_base = 36
protected

Référencé par _adapt(), _decode(), _decode_digit(), et _encode().

◆ $_damp

$_damp = 700
protected

◆ $_error

$_error = false
protected

Référencé par get_last_error().

◆ $_idn_version

$_idn_version = 2003
protected

◆ $_initial_bias

$_initial_bias = 72
protected

Référencé par _decode(), et _encode().

◆ $_initial_n

$_initial_n = 0x80
protected

Référencé par _decode(), et _encode().

◆ $_invalid_ucs

$_invalid_ucs = 0x80000000
protected

◆ $_lbase

$_lbase = 0x1100
protected

Référencé par _hangul_compose().

◆ $_lcount

$_lcount = 19
protected

◆ $_max_ucs

$_max_ucs = 0x10FFFF
protected

◆ $_mb_string_overload

$_mb_string_overload = null
staticprotected

◆ $_ncount

$_ncount = 588
protected

◆ $_punycode_prefix

$_punycode_prefix = 'xn--'
protected

◆ $_sbase

$_sbase = 0xAC00
protected

Référencé par _hangul_compose().

◆ $_scount

$_scount = 11172
protected

◆ $_skew

$_skew = 38
protected

◆ $_strict_mode

$_strict_mode = false
protected

◆ $_tbase

$_tbase = 0x11A7
protected

Référencé par _hangul_compose().

◆ $_tcount

$_tcount = 28
protected

◆ $_tmax

$_tmax = 26
protected

◆ $_tmin

$_tmin = 1
protected

Référencé par _adapt().

◆ $_vbase

$_vbase = 0x1161
protected

Référencé par _hangul_compose().

◆ $_vcount

$_vcount = 21
protected

◆ $NP [1/2]

$NP = array()

◆ $NP [2/2]

$NP
staticprotected

Holds all relevant mapping tables See RFC3454 for details

array

Depuis
0.5.2

La documentation de cette classe a été générée à partir du fichier suivant :