class PunycodeHelper

Joomla Platform String Punycode Class

Class for handling UTF-8 URLs Wraps the Punycode library All functions assume the validity of utf-8 URLs.

Methods

static  string
toPunycode( string $utfString)

Transforms a UTF-8 string to a Punycode string

static  string
fromPunycode( string $punycodeString)

Transforms a Punycode string to a UTF-8 string

static  string
urlToPunycode( string $uri)

Transforms a UTF-8 URL to a Punycode URL

static  string
urlToUTF8( string $uri)

Transforms a Punycode URL to a UTF-8 URL

static  string
emailToPunycode( string $email)

Transforms a UTF-8 email to a Punycode email This assumes a valid email address

static  string
emailToUTF8( string $email)

Transforms a Punycode email to a UTF-8 email This assumes a valid email address

Details

static string toPunycode( string $utfString)

Transforms a UTF-8 string to a Punycode string

Parameters

string $utfString The UTF-8 string to transform

Return Value

string The punycode string

static string fromPunycode( string $punycodeString)

Transforms a Punycode string to a UTF-8 string

Parameters

string $punycodeString The Punycode string to transform

Return Value

string The UF-8 URL

static string urlToPunycode( string $uri)

Transforms a UTF-8 URL to a Punycode URL

Parameters

string $uri The UTF-8 URL to transform

Return Value

string The punycode URL

static string urlToUTF8( string $uri)

Transforms a Punycode URL to a UTF-8 URL

Parameters

string $uri The Punycode URL to transform

Return Value

string The UTF-8 URL

static string emailToPunycode( string $email)

Transforms a UTF-8 email to a Punycode email This assumes a valid email address

Parameters

string $email The UTF-8 email to transform

Return Value

string The punycode email

static string emailToUTF8( string $email)

Transforms a Punycode email to a UTF-8 email This assumes a valid email address

Parameters

string $email The punycode email to transform

Return Value

string The punycode email