b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 2.4) [ class tree: libs ] [ index: libs ] [ all elements ]

Class: idna_convert

Source Location: /blogs/inc/_ext/idna/_idna_convert.class.php

Class idna_convert

Class Overview

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.

Located in /blogs/inc/_ext/idna/_idna_convert.class.php [line 65]



		
				Author(s):
		
		
		
Information Tags:
Version:  0.5.0

Properties

Methods

[ Top ]
Direct descendents
Child Class Description
Net_IDNA_php4 Adapter class for aligning the API of idna_convert with that of Net_IDNA

[ Top ]
Property Summary
mixed   $_allow_overlong  
mixed   $_api_encoding  
mixed   $_base  
mixed   $_damp  
mixed   $_error  
mixed   $_initial_bias  
mixed   $_initial_n  
mixed   $_invalid_ucs  
mixed   $_lbase  
mixed   $_lcount  
mixed   $_max_ucs  
mixed   $_ncount  
mixed   $_punycode_prefix  
mixed   $_sbase  
mixed   $_scount  
mixed   $_skew  
mixed   $_strict_mode  
mixed   $_tbase  
mixed   $_tcount  
mixed   $_tmax  
mixed   $_tmin  
mixed   $_vbase  
mixed   $_vcount  

[ Top ]
Method Summary
idna_convert   idna_convert()  
string   decode()   Decode a given ACE domain name
string   encode()   Encode a given UTF-8 domain name
string   get_last_error()   Use this method to get the last error ocurred
boolean   set_parameter()   Sets a new option value. Available options and values:

[ Top ]
Properties
mixed   $_allow_overlong = false [line 101]

[ Top ]
mixed   $_api_encoding = 'utf8' [line 100]

[ Top ]
mixed   $_base = 36 [line 80]

[ Top ]
mixed   $_damp = 700 [line 84]

[ Top ]
mixed   $_error = false [line 96]

[ Top ]
mixed   $_initial_bias = 72 [line 85]

[ Top ]
mixed   $_initial_n = 0x80 [line 86]

[ Top ]
mixed   $_invalid_ucs = 0x80000000 [line 78]

[ Top ]
mixed   $_lbase = 0x1100 [line 88]

[ Top ]
mixed   $_lcount = 19 [line 91]

[ Top ]
mixed   $_max_ucs = 0x10FFFF [line 79]

[ Top ]
mixed   $_ncount = 588 [line 94]

[ Top ]
mixed   $_punycode_prefix = 'xn--' [line 77]

[ Top ]
mixed   $_sbase = 0xAC00 [line 87]

[ Top ]
mixed   $_scount = 11172 [line 95]

[ Top ]
mixed   $_skew = 38 [line 83]

[ Top ]
mixed   $_strict_mode = false [line 102]

[ Top ]
mixed   $_tbase = 0x11A7 [line 90]

[ Top ]
mixed   $_tcount = 28 [line 93]

[ Top ]
mixed   $_tmax = 26 [line 82]

[ Top ]
mixed   $_tmin = 1 [line 81]

[ Top ]
mixed   $_vbase = 0x1161 [line 89]

[ Top ]
mixed   $_vcount = 21 [line 92]

[ Top ]
Methods
Constructor idna_convert  [line 105]

  idna_convert idna_convert( [ $options = false]  )

Parameters:
   $options: 


[ Top ]
decode  [line 176]

  string decode( string $input, [ $one_time_encoding = false]  )

Decode a given ACE domain name

Parameters:
string   $input:  Domain name (ACE string) [@param string Desired output encoding, see set_parameter]
   $one_time_encoding: 

API Tags:
Return:  Decoded Domain name (UTF-8 or UCS-4)
Access:  public


[ Top ]
encode  [line 278]

  string encode( string $decoded, [ $one_time_encoding = false]  )

Encode a given UTF-8 domain name

Parameters:
string   $decoded:  Domain name (UTF-8 or UCS-4) [@param string Desired input encoding, see set_parameter]
   $one_time_encoding: 

API Tags:
Return:  Encoded Domain name (ACE string)
Access:  public


[ Top ]
get_last_error  [line 362]

  string get_last_error( void 0  )

Use this method to get the last error ocurred

Parameters:
void   0: 

API Tags:
Return:  The last error, that occured
Access:  public


[ Top ]
set_parameter  [line 136]

  boolean set_parameter( mixed $option, [string $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

Parameters:
mixed   $option:  Parameter to set (string: single parameter; array of Parameter => Value pairs)
string   $value:  Value to use (if parameter 1 is a string)

API Tags:
Return:  true on success, false otherwise
Access:  public


[ Top ]

Documentation generated on Sat, 06 Mar 2010 03:34:57 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).