PHPackages                             froxlor/idna-convert-legacy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. froxlor/idna-convert-legacy

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

froxlor/idna-convert-legacy
===========================

A library for encoding and decoding internationalized domain names

v3.0.4(6y ago)247.1k—8.3%21LGPL-2.1+PHPPHP ^7.2.0

Since Jan 6Pushed 4y agoCompare

[ Source](https://github.com/Froxlor/idna-convert-legacy)[ Packagist](https://packagist.org/packages/froxlor/idna-convert-legacy)[ Docs](http://idnaconv.net/)[ RSS](/packages/froxlor-idna-convert-legacy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (16)Used By (1)

IDNA Convert - pure PHP IDNA converter
======================================

[](#idna-convert---pure-php-idna-converter)

[![latest stable version](https://camo.githubusercontent.com/e824732348ce4c2c8ad9b319827009a0cf9e86d7907d1645282ee1d758ea4848/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f616c676f32362d6d617474686961732f69646e612d636f6e766572742e737667)](https://camo.githubusercontent.com/e824732348ce4c2c8ad9b319827009a0cf9e86d7907d1645282ee1d758ea4848/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f616c676f32362d6d617474686961732f69646e612d636f6e766572742e737667)[![Travis CI status](https://camo.githubusercontent.com/bcf6bbae036c5dc1e3b1715330fba05d0ed9295b20c5e86fbda2f735b01040f2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616c676f32362d6d617474686961732f69646e612d636f6e766572742e737667)](https://camo.githubusercontent.com/bcf6bbae036c5dc1e3b1715330fba05d0ed9295b20c5e86fbda2f735b01040f2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616c676f32362d6d617474686961732f69646e612d636f6e766572742e737667)

Project homepage:
by Matthias Sommerfeld

Introduction
------------

[](#introduction)

The library IdnaConvert allows to convert internationalized domain names (see [RFC 3492](http://www.ietf.org/rfc/rfc3492.txt), [RFC 5890](http://www.ietf.org/rfc/rfc5890.txt), [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt), [RFC 5892](http://www.ietf.org/rfc/rfc5892.txt), [RFC 5893](http://www.ietf.org/rfc/rfc5893.txt), [RFC 5894](http://www.ietf.org/rfc/rfc5894.txt), [RFC 6452](http://www.ietf.org/rfc/rfc6452.txt), for details) as they can be used with various registries worldwide to be translated between their original (localized) form and their encoded form as it will be used in the DNS (Domain Name System).

The library provides two classes (`ToIdn` and `ToUnicode` respectively), which expose three public methods to convert between the respective forms. See the Example section below. This allows you to convert host names (simple labels like `localhost` or FQHNs like `some-host.domain.example`), email addresses and complete URLs.

Errors, incorrectly encoded or invalid strings will lead to various exceptions. They should help you to find out, what went wrong.

Unicode strings are expected to be UTF-8 strings. ACE strings (the Punycode form) are always 7bit ASCII strings.

Installation
------------

[](#installation)

### Via Composer

[](#via-composer)

```
composer require algo26-matthias/idna-convert

```

### Official ZIP Package

[](#official-zip-package)

The official ZIP packages are discontinued. Stick to Composer or Github to acquire your copy, please.

Upgrading from a previous version
---------------------------------

[](#upgrading-from-a-previous-version)

See [the upgrading notes](./UPGRADING.md) to learn about upgrading from a previous version.

Examples
--------

[](#examples)

### Example 1.

[](#example-1)

Say we wish to encode the domain name nörgler.com:

```
