Net
[ class tree: Net ] [ index: Net ] [ all elements ]

Class: Net_IDNA

Source Location: /Net_IDNA-0.8.1/Net/IDNA.php

Class Overview


Encode/decode Internationalized Domain Names.


Author(s):

Version:

  • $Id: IDNA.php 300850 2010-06-29 09:47:19Z neufeind $

Methods


Child classes:

Inherited Variables

Inherited Methods


Class Details

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



[ Top ]


Method Detail

Net_IDNA (Constructor)   [line 3011]

Net_IDNA Net_IDNA( [array $options = false])

Constructor

Parameters:

array   $options   — 

[ Top ]

decode   [line 2146]

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

Decode a given ACE domain name
  • Return: Decoded Domain name (UTF-8 or UCS-4)
  • Access: public

Parameters:

string   $input   —  Domain name (ACE string)
string   $one_time_encoding   —  Desired output encoding, see set_parameter

[ Top ]

encode   [line 2234]

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

Encode a given UTF-8 domain name
  • Return: Encoded Domain name (ACE string)
  • Access: public

Parameters:

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

[ Top ]

getInstance   [line 3038]

void getInstance( [ $params = array()])


Parameters:

   $params   — 

[ Top ]

get_last_error   [line 2322]

string get_last_error( )

Use this method to get the last error ocurred
  • Return: The last error, that occured
  • Access: public

[ Top ]

Net_IDNA_php4   [line 2077]

void Net_IDNA_php4( [ $options = false])


Parameters:

   $options   — 

[ Top ]

setParams   [line 3024]

boolean setParams( mixed $option, [string $param = false])

Empty method body
  • Return: true on success, false otherwise
  • Access: public

Parameters:

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

[ Top ]

set_parameter   [line 2104]

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

  • 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 ]

singleton   [line 3057]

Net_IDNA singleton( [array $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.
  • Deprecated:
  • Access: public

Parameters:

array   $params   —  Set of paramaters

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:37:52 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.