run:R W Run
DIR
2026-04-08 19:47:42
R W Run
1.33 KB
2026-04-08 19:32:05
R W Run
1.03 KB
2026-04-08 19:32:05
R W Run
1.47 KB
2026-04-08 19:32:05
R W Run
error_log
📄README.md
1# Punycode
2
3[![Build Status](https://secure.travis-ci.org/true/php-punycode.png?branch=master)](http://travis-ci.org/true/php-punycode)
4[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/true/php-punycode/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/true/php-punycode/?branch=master)
5[![Code Coverage](https://scrutinizer-ci.com/g/true/php-punycode/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/true/php-punycode/?branch=master)
6[![Latest Stable Version](https://poser.pugx.org/true/punycode/version.png)](https://packagist.org/packages/true/punycode)
7
8A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA).
9
10
11## Install
12
13```
14composer require true/punycode:~2.0
15```
16
17
18## Usage
19
20```php
21<?php
22
23// Import Punycode
24use TrueBV\Punycode;
25
26$Punycode = new Punycode();
27var_dump($Punycode->encode('renangonçalves.com'));
28// outputs: xn--renangonalves-pgb.com
29
30var_dump($Punycode->decode('xn--renangonalves-pgb.com'));
31// outputs: renangonçalves.com
32```
33
34
35## FAQ
36
37### 1. What is this library for?
38
39This library converts a Unicode encoded domain name to a IDNA ASCII form and vice-versa.
40
41
42### 2. Why should I use this instead of [PHP's IDN Functions](http://php.net/manual/en/ref.intl.idn.php)?
43
44If you can compile the needed dependencies (intl, libidn) there is not much difference.
45But if you want to write portable code between hosts (including Windows and Mac OS), or can't install PECL extensions, this is the right library for you.
46