encode($domain); } } /** * Convert IDNA (punycode) domain into UTF-8 * * @param string $domain * @return string */ public static function decodeIdna($domain) { if (function_exists('idn_to_utf8')) { return idn_to_utf8($domain); } else { $decoder = new \TrueBV\Punycode(); return $decoder->decode($domain); } } }