Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.
/ php-punycode Public archive

A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA) for PHP. Actively maintained alternative can be found here: https://github.com/symfony/polyfill-intl-idn

License

Notifications You must be signed in to change notification settings

true/php-punycode

Folders and files

NameName
Last commit message
Last commit date
Aug 9, 2016
Sep 28, 2016
May 20, 2016
Aug 12, 2014
Nov 16, 2016
Aug 9, 2016
Feb 17, 2014
Jun 24, 2015
Nov 16, 2016
Jun 24, 2015

Repository files navigation

Punycode

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version

A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA).

Install

composer require true/punycode:~2.0

Usage

<?php

// Import Punycode
use TrueBV\Punycode;

$Punycode = new Punycode();
var_dump($Punycode->encode('renangonçalves.com'));
// outputs: xn--renangonalves-pgb.com

var_dump($Punycode->decode('xn--renangonalves-pgb.com'));
// outputs: renangonçalves.com

FAQ

1. What is this library for?

This library converts a Unicode encoded domain name to a IDNA ASCII form and vice-versa.

2. Why should I use this instead of PHP's IDN Functions?

If you can compile the needed dependencies (intl, libidn) there is not much difference. But 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.

About

A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA) for PHP. Actively maintained alternative can be found here: https://github.com/symfony/polyfill-intl-idn

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages