\TrueBVPunycode

Punycode implementation as described in RFC 3492

Summary

Methods
Properties
Constants
__construct()
encode()
decode()
No public properties found
BASE
TMIN
TMAX
SKEW
DAMP
INITIAL_BIAS
INITIAL_N
PREFIX
DELIMITER
encodePart()
decodePart()
calculateThreshold()
adapt()
listCodePoints()
charToCodePoint()
codePointToChar()
$encodeTable
$decodeTable
$encoding
N/A
No private methods found
No private properties found
N/A

Constants

BASE

BASE

Bootstring parameter values

TMIN

TMIN

TMAX

TMAX

SKEW

SKEW

DAMP

DAMP

INITIAL_BIAS

INITIAL_BIAS

INITIAL_N

INITIAL_N

PREFIX

PREFIX

DELIMITER

DELIMITER

Properties

$encodeTable

$encodeTable : 

Encode table

Type

$decodeTable

$decodeTable : 

Decode table

Type

$encoding

$encoding : 

Character encoding

Type

Methods

__construct()

__construct(string  $encoding = 'UTF-8') 

Constructor

Parameters

string $encoding

Character encoding

encode()

encode(string  $input) : string

Encode a domain to its Punycode version

Parameters

string $input

Domain name in Unicode to be encoded

Returns

string —

Punycode representation in ASCII

decode()

decode(string  $input) : string

Decode a Punycode domain name to its Unicode counterpart

Parameters

string $input

Domain name in Punycode

Returns

string —

Unicode domain name

encodePart()

encodePart(string  $input) : string

Encode a part of a domain name, such as tld, to its Punycode version

Parameters

string $input

Part of a domain name

Returns

string —

Punycode representation of a domain part

decodePart()

decodePart(string  $input) : string

Decode a part of domain name, such as tld

Parameters

string $input

Part of a domain name

Returns

string —

Unicode domain part

calculateThreshold()

calculateThreshold(integer  $k, integer  $bias) : integer

Calculate the bias threshold to fall between TMIN and TMAX

Parameters

integer $k
integer $bias

Returns

integer

adapt()

adapt(integer  $delta, integer  $numPoints, boolean  $firstTime) : integer

Bias adaptation

Parameters

integer $delta
integer $numPoints
boolean $firstTime

Returns

integer

listCodePoints()

listCodePoints(string  $input) : array

List code points for a given input

Parameters

string $input

Returns

array —

Multi-dimension array with basic, non-basic and aggregated code points

charToCodePoint()

charToCodePoint(string  $char) : integer

Convert a single or multi-byte character to its code point

Parameters

string $char

Returns

integer

codePointToChar()

codePointToChar(integer  $code) : string

Convert a code point to its single or multi-byte character

Parameters

integer $code

Returns

string