note 108900 added to function.idn-to-ascii

From: Date: Sun, 03 Jun 2012 05:08:41 +0000
Subject: note 108900 added to function.idn-to-ascii
Groups: php.notes 
Request: Send a blank email to php-notes+get-188375@lists.php.net to get a copy of this message
The notes on this function are not very clear and a little misleading. Firstly, <=5.3, you will need to make use of one of several scripts or classes available on the internet which might, or might not, require the installation of of the intl and idn PECL extensions ...and you will need to have !<4.0 in order to be able to install both. Secondly, if you have >=5.4 you will not require the PECL extensions. Third, use of utf8_encode() is not necessary. In fact, it will potentially prevent idn_to_ascii() from working at all. On my setup it was necessary to change the charset in the script meta tags to UTF-8: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> ...and to change charset_default in the php.ini file (/usr/local/lib/php.ini, whereis php.ini, find / -name php.ini): default_charset = "UTF-8" The above changes mean that idn_to_ascii() can now be used with that syntax (no need for utf8_encode()). Previously, the function worked to convert some IDNs, but failed to convert Japanese and Cyrillic IDNs. Further, no additional locales were enabled or added, and Apache's charset file was left unmodified. ---- Server IP: 69.147.83.197 Probable Submitter: 78.129.220.46 ---- Manual Page -- http://www.php.net/manual/en/function.idn-to-ascii.php Edit -- https://master.php.net/note/edit/108900 Del: integrated -- https://master.php.net/note/delete/108900/integrated Del: useless -- https://master.php.net/note/delete/108900/useless Del: bad code -- https://master.php.net/note/delete/108900/bad+code Del: spam -- https://master.php.net/note/delete/108900/spam Del: non-english -- https://master.php.net/note/delete/108900/non-english Del: in docs -- https://master.php.net/note/delete/108900/in+docs Del: other reasons-- https://master.php.net/note/delete/108900 Reject -- https://master.php.net/note/reject/108900 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#188375) next »