| 1 | <?php |
||
| 7 | class PunycodeWrapper |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var Punycode |
||
| 11 | */ |
||
| 12 | private static $punycode; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var bool |
||
| 16 | */ |
||
| 17 | private $idnSupport = false; |
||
| 18 | |||
| 19 | public function __construct() |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Encode a domain to its Punycode version |
||
| 33 | * |
||
| 34 | * @param string $input Domain name in Unicode to be encoded |
||
| 35 | * |
||
| 36 | * @return string Punycode representation in ASCII |
||
| 37 | */ |
||
| 38 | public function encode($input) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Decode a Punycode domain name to its Unicode counterpart |
||
| 49 | * |
||
| 50 | * @param string $input Domain name in Punycode |
||
| 51 | * |
||
| 52 | * @return string Unicode domain name |
||
| 53 | */ |
||
| 54 | public function decode($input) |
||
| 62 | } |