Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
For example, through idna_convert
require_once('idna_convert.class.php');
$IDN = new idna_convert();
$domain = 'xn--j1ail.xn--p1ai';
$domain = $IDN->decode($domain);
echo $domain;
A domain with national characters is nothing more than a punycode encoded string with a special prefix. You need to find a lib for your language (as google shows, there is one) that will translate the j1ail and p1ai strings from punycode into the national language entry (Russian)
Look here:
https://phlymail.com/en/downloads/idna-convert.html
Work example:
http://idnaconv.phlymail.de/index.php?encoded=xn--...
https://github.com/mabrahamde/php-idna-converter
<?php
require_once('vendor/autoload.php');
$idn = new \idna_convert(array('idn_version' => 2008));
echo $idn->encode('lübeck.de'); // prints 'xn--lbeck-kva.de'
echo $idn->decode('xn--lbeck-kva.de') // prints 'lübeck.de'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question