PHP 클래스 Punycode

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Punycode implementation as described in RFC 3492
또한 보기: https://github.com/true/php-punycode
파일 보기 프로젝트 열기: zblogcn/zblogphp 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$decodeTable Decode table
$encodeTable Encode table
$encoding Character encoding

공개 메소드들

메소드 설명
__construct ( string $encoding = 'UTF-8' ) Constructor
decode ( string $input ) : string Decode a Punycode domain name to its Unicode counterpart
encode ( string $input ) : string Encode a domain to its Punycode version

보호된 메소드들

메소드 설명
adapt ( integer $delta, integer $numPoints, boolean $firstTime ) : integer Bias adaptation
calculateThreshold ( integer $k, integer $bias ) : integer Calculate the bias threshold to fall between TMIN and TMAX
charToCodePoint ( string $char ) : integer Convert a single or multi-byte character to its code point
codePointToChar ( integer $code ) : string Convert a code point to its single or multi-byte character
decodePart ( string $input ) : string Decode a part of domain name, such as tld
encodePart ( string $input ) : string Encode a part of a domain name, such as tld, to its Punycode version
listCodePoints ( string $input ) : array List code points for a given input

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( string $encoding = 'UTF-8' )
$encoding string Character encoding

adapt() 보호된 메소드

Bias adaptation
protected adapt ( integer $delta, integer $numPoints, boolean $firstTime ) : integer
$delta integer
$numPoints integer
$firstTime boolean
리턴 integer

calculateThreshold() 보호된 메소드

Calculate the bias threshold to fall between TMIN and TMAX
protected calculateThreshold ( integer $k, integer $bias ) : integer
$k integer
$bias integer
리턴 integer

charToCodePoint() 보호된 메소드

Convert a single or multi-byte character to its code point
protected charToCodePoint ( string $char ) : integer
$char string
리턴 integer

codePointToChar() 보호된 메소드

Convert a code point to its single or multi-byte character
protected codePointToChar ( integer $code ) : string
$code integer
리턴 string

decode() 공개 메소드

Decode a Punycode domain name to its Unicode counterpart
public decode ( string $input ) : string
$input string Domain name in Punycode
리턴 string Unicode domain name

decodePart() 보호된 메소드

Decode a part of domain name, such as tld
protected decodePart ( string $input ) : string
$input string Part of a domain name
리턴 string Unicode domain part

encode() 공개 메소드

Encode a domain to its Punycode version
public encode ( string $input ) : string
$input string Domain name in Unicode to be encoded
리턴 string Punycode representation in ASCII

encodePart() 보호된 메소드

Encode a part of a domain name, such as tld, to its Punycode version
protected encodePart ( string $input ) : string
$input string Part of a domain name
리턴 string Punycode representation of a domain part

listCodePoints() 보호된 메소드

List code points for a given input
protected listCodePoints ( string $input ) : array
$input string
리턴 array Multi-dimension array with basic, non-basic and aggregated code points

프로퍼티 상세

$decodeTable 보호되어 있는 정적으로 프로퍼티

Decode table
protected static $decodeTable

$encodeTable 보호되어 있는 정적으로 프로퍼티

Encode table
protected static $encodeTable

$encoding 보호되어 있는 프로퍼티

Character encoding
protected $encoding