Class idna_convert

Description

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.

  • author: Matthias Sommerfeld <mso@phlylabs.de>
  • version: 0.5.1
  • copyright: 2004-2007 phlyLabs Berlin, http://phlylabs.de

Located in /libraries/simplepie/idn/idna_convert.class.php (line 54)


	
			
Direct descendents
Class Description
 class Net_IDNA_php4 Adapter class for aligning the API of idna_convert with that of Net_IDNA
Variable Summary
 mixed $_base
 mixed $_damp
 mixed $_error
 mixed $_initial_n
 mixed $_lbase
 mixed $_lcount
 mixed $_max_ucs
 mixed $_ncount
 mixed $_sbase
 mixed $_scount
 mixed $_skew
 mixed $_tbase
 mixed $_tcount
 mixed $_tmax
 mixed $_tmin
 mixed $_vbase
 mixed $_vcount
Method Summary
 idna_convert idna_convert ([ $options = false])
 string decode (string $input, [ $one_time_encoding = false])
 string encode (string $decoded, [ $one_time_encoding = false])
 string get_last_error (void 0)
 boolean set_parameter (mixed $option, [string $value = false])
Variables
mixed $_allow_overlong = false (line 90)
mixed $_api_encoding = 'utf8' (line 89)
mixed $_base = 36 (line 69)
mixed $_damp = 700 (line 73)
mixed $_error = false (line 85)
mixed $_initial_bias = 72 (line 74)
mixed $_initial_n = 0x80 (line 75)
mixed $_invalid_ucs = 0x80000000 (line 67)
mixed $_lbase = 0x1100 (line 77)
mixed $_lcount = 19 (line 80)
mixed $_max_ucs = 0x10FFFF (line 68)
mixed $_ncount = 588 (line 83)
mixed $_punycode_prefix = 'xn--' (line 66)
mixed $_sbase = 0xAC00 (line 76)
mixed $_scount = 11172 (line 84)
mixed $_skew = 38 (line 72)
mixed $_strict_mode = false (line 91)
mixed $_tbase = 0x11A7 (line 79)
mixed $_tcount = 28 (line 82)
mixed $_tmax = 26 (line 71)
mixed $_tmin = 1 (line 70)
mixed $_vbase = 0x1161 (line 78)
mixed $_vcount = 21 (line 81)
Methods
Constructor idna_convert (line 94)
idna_convert idna_convert ([ $options = false])
  • $options
decode (line 165)

Decode a given ACE domain name

  • return: Decoded Domain name (UTF-8 or UCS-4)
  • access: public
string decode (string $input, [ $one_time_encoding = false])
  • string $input: Domain name (ACE string) [@param string Desired output encoding, see set_parameter]
  • $one_time_encoding
encode (line 267)

Encode a given UTF-8 domain name

  • return: Encoded Domain name (ACE string)
  • access: public
string encode (string $decoded, [ $one_time_encoding = false])
  • string $decoded: Domain name (UTF-8 or UCS-4) [@param string Desired input encoding, see set_parameter]
  • $one_time_encoding
get_last_error (line 351)

Use this method to get the last error ocurred

  • return: The last error, that occured
  • access: public
string get_last_error (void 0)
  • void 0
set_parameter (line 125)

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

  • return: true on success, false otherwise
  • access: public
boolean set_parameter (mixed $option, [string $value = false])
  • mixed $option: Parameter to set (string: single parameter; array of Parameter => Value pairs)
  • string $value: Value to use (if parameter 1 is a string)

Documentation generated on Tue, 19 Nov 2013 15:05:13 +0100 by phpDocumentor 1.4.3