‪TYPO3CMS  9.5
Mso\IdnaConvert\IdnaConvert Class Reference

Public Member Functions

 __construct ($params=null)
 
 getClassVersion ()
 
string getEncoding ()
 
 setEncoding ($encoding)
 
bool isStrictMode ()
 
 setStrictMode ($strictMode)
 
int getIdnVersion ()
 
 setIdnVersion ($idnVersion)
 
string decode ($input, $one_time_encoding=null)
 
string encode ($decoded, $one_time_encoding=false)
 
string encodeUri ($uri)
 

Public Attributes

const Version = '1.1.0'
 
const SubVersion = 'main'
 

Protected Member Functions

Mso IdnaConvert Punycode punycodeFactory ()
 

Protected Attributes

 $encoding = 'utf8'
 
 $strictMode = false
 
 $idnVersion = '2008'
 
 $NamePrepData = null
 
 $UnicodeTranscoder = null
 

Detailed Description

Definition at line 54 of file IdnaConvert.php.

Constructor & Destructor Documentation

◆ __construct()

Mso\IdnaConvert\IdnaConvert::__construct (   $params = null)

the constructor

Parameters
array | null$params‪Parameters to control the class' behaviour
Since
0.5.2

Definition at line 73 of file IdnaConvert.php.

References Mso\IdnaConvert\IdnaConvert\setEncoding(), Mso\IdnaConvert\IdnaConvert\setIdnVersion(), and Mso\IdnaConvert\IdnaConvert\setStrictMode().

Member Function Documentation

◆ decode()

string Mso\IdnaConvert\IdnaConvert::decode (   $input,
  $one_time_encoding = null 
)

Decode a given ACE domain name

Parameters
string$input‪Domain name (ACE string) [
string$one_time_encoding‪Desired output encoding]
Returns
‪string Decoded Domain name (UTF-8 or UCS-4)

Definition at line 174 of file IdnaConvert.php.

References Mso\IdnaConvert\UnicodeTranscoder\convert(), and Mso\IdnaConvert\IdnaConvert\punycodeFactory().

◆ encode()

string Mso\IdnaConvert\IdnaConvert::encode (   $decoded,
  $one_time_encoding = false 
)

Encode a given UTF-8 domain name

Parameters
string$decoded‪Domain name (UTF-8 or UCS-4) [
boolean$one_time_encoding‪Desired input encoding, see set_parameter]
Returns
‪string Encoded Domain name (ACE string)

Definition at line 276 of file IdnaConvert.php.

References Mso\IdnaConvert\IdnaConvert\$encoding, $output, Mso\IdnaConvert\UnicodeTranscoder\convert(), and Mso\IdnaConvert\IdnaConvert\punycodeFactory().

Referenced by Mso\IdnaConvert\IdnaConvert\encodeUri().

◆ encodeUri()

string Mso\IdnaConvert\IdnaConvert::encodeUri (   $uri)

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

Parameters
string$uri‪Expects the URI as a UTF-8 (or ASCII) string
Returns
‪string The URI encoded to Punycode, everything but the host component is left alone
Since
0.6.4

Definition at line 362 of file IdnaConvert.php.

References Mso\IdnaConvert\IdnaConvert\encode().

◆ getClassVersion()

Mso\IdnaConvert\IdnaConvert::getClassVersion ( )

Definition at line 95 of file IdnaConvert.php.

References Mso\IdnaConvert\IdnaConvert\SubVersion.

◆ getEncoding()

string Mso\IdnaConvert\IdnaConvert::getEncoding ( )
Returns
‪string

Definition at line 103 of file IdnaConvert.php.

References Mso\IdnaConvert\IdnaConvert\$encoding.

◆ getIdnVersion()

int Mso\IdnaConvert\IdnaConvert::getIdnVersion ( )
Returns
‪int

Definition at line 143 of file IdnaConvert.php.

References Mso\IdnaConvert\IdnaConvert\$idnVersion.

◆ isStrictMode()

bool Mso\IdnaConvert\IdnaConvert::isStrictMode ( )
Returns
‪bool

Definition at line 127 of file IdnaConvert.php.

References Mso\IdnaConvert\IdnaConvert\$strictMode.

◆ punycodeFactory()

Mso IdnaConvert Punycode Mso\IdnaConvert\IdnaConvert::punycodeFactory ( )
protected

The actual punycode class is rather costly, as well as passing the huge nameprep database around. This factory method allows to ease the burden when dealing with multiple IDN versions.

Returns
‪\Mso\IdnaConvert\Punycode

Definition at line 392 of file IdnaConvert.php.

References Mso\IdnaConvert\IdnaConvert\$idnVersion.

Referenced by Mso\IdnaConvert\IdnaConvert\decode(), and Mso\IdnaConvert\IdnaConvert\encode().

◆ setEncoding()

Mso\IdnaConvert\IdnaConvert::setEncoding (   $encoding)
Parameters
string$encoding

Definition at line 111 of file IdnaConvert.php.

References Mso\IdnaConvert\IdnaConvert\$encoding.

Referenced by Mso\IdnaConvert\IdnaConvert\__construct().

◆ setIdnVersion()

Mso\IdnaConvert\IdnaConvert::setIdnVersion (   $idnVersion)
Parameters
int$idnVersion

Definition at line 151 of file IdnaConvert.php.

References Mso\IdnaConvert\IdnaConvert\$idnVersion.

Referenced by Mso\IdnaConvert\IdnaConvert\__construct().

◆ setStrictMode()

Mso\IdnaConvert\IdnaConvert::setStrictMode (   $strictMode)
Parameters
bool$strictMode

Definition at line 135 of file IdnaConvert.php.

References Mso\IdnaConvert\IdnaConvert\$strictMode.

Referenced by Mso\IdnaConvert\IdnaConvert\__construct().

Member Data Documentation

◆ $encoding

Mso\IdnaConvert\IdnaConvert::$encoding = 'utf8'
protected

◆ $idnVersion

Mso\IdnaConvert\IdnaConvert::$idnVersion = '2008'
protected

◆ $NamePrepData

Mso\IdnaConvert\IdnaConvert::$NamePrepData = null
protected

Definition at line 64 of file IdnaConvert.php.

◆ $strictMode

Mso\IdnaConvert\IdnaConvert::$strictMode = false
protected

◆ $UnicodeTranscoder

Mso\IdnaConvert\IdnaConvert::$UnicodeTranscoder = null
protected

Definition at line 65 of file IdnaConvert.php.

◆ SubVersion

const Mso\IdnaConvert\IdnaConvert::SubVersion = 'main'

Definition at line 57 of file IdnaConvert.php.

Referenced by Mso\IdnaConvert\IdnaConvert\getClassVersion().

◆ Version

const Mso\IdnaConvert\IdnaConvert::Version = '1.1.0'

Definition at line 56 of file IdnaConvert.php.