Zikula 1.0.1
[ class tree: Zikula 1.0.1 ] [ index: Zikula 1.0.1 ] [ all elements ]

Class: idna_convert

Source Location: /includes/classes/idna/idna_convert.class.php

Class Overview


Encode/decode Internationalized Domain Names.


Author(s):

Version:

  • 0.4.2

Variables

Methods


Child classes:

Net_IDNA_php4
Adapter class for aligning the API of idna_convert with that of

Class Details

[line 61]
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.




Tags:

author:  Matthias Sommerfeld <mso@phlylabs.de>
version:  0.4.2


[ Top ]


Class Variables

$_allow_overlong =   false

[line 100]


Type:   mixed


[ Top ]

$_api_encoding =   'utf8'

[line 99]


Type:   mixed


[ Top ]

$_base =             36

[line 79]


Type:   mixed


[ Top ]

$_damp =             700

[line 83]


Type:   mixed


[ Top ]

$_error =            false

[line 95]


Type:   mixed


[ Top ]

$_initial_bias =     72

[line 84]


Type:   mixed


[ Top ]

$_initial_n =        0x80

[line 85]


Type:   mixed


[ Top ]

$_invalid_ucs =      0x80000000

[line 77]


Type:   mixed


[ Top ]

$_lbase =            0x1100

[line 87]


Type:   mixed


[ Top ]

$_lcount =           19

[line 90]


Type:   mixed


[ Top ]

$_max_ucs =          0x10FFFF

[line 78]


Type:   mixed


[ Top ]

$_ncount =           588

[line 93]


Type:   mixed


[ Top ]

$_punycode_prefix =  'xn--'

[line 76]


Type:   mixed


[ Top ]

$_sbase =            0xAC00

[line 86]


Type:   mixed


[ Top ]

$_scount =           11172

[line 94]


Type:   mixed


[ Top ]

$_skew =             38

[line 82]


Type:   mixed


[ Top ]

$_strict_mode =   false

[line 101]


Type:   mixed


[ Top ]

$_tbase =            0x11a7

[line 89]


Type:   mixed


[ Top ]

$_tcount =           28

[line 92]


Type:   mixed


[ Top ]

$_tmax =             26

[line 81]


Type:   mixed


[ Top ]

$_tmin =             1

[line 80]


Type:   mixed


[ Top ]

$_vbase =            0x1161

[line 88]


Type:   mixed


[ Top ]

$_vcount =           21

[line 91]


Type:   mixed


[ Top ]



Class Methods


constructor idna_convert [line 104]

idna_convert idna_convert( [ $options = false])



Parameters:

   $options  

[ Top ]

method decode [line 175]

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

Decode a given ACE domain name



Tags:

return:  Decoded Domain name (UTF-8 or UCS-4)
access:  public


Parameters:

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

[ Top ]

method encode [line 265]

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

Encode a given UTF-8 domain name



Tags:

return:  Encoded Domain name (ACE string)
access:  public


Parameters:

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

[ Top ]

method get_last_error [line 352]

string get_last_error( void 0)

Use this method to get the last error ocurred



Tags:

return:  The last error, that occured
access:  public


Parameters:

void   0  

[ Top ]

method set_parameter [line 135]

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




Tags:

return:  true on success, false otherwise
access:  public


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)

[ Top ]


Documentation generated on Fri, 18 Jul 2008 21:46:49 +0200 by phpDocumentor 1.4.1