php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78671 idn-to-utf8 : Encoding failure for lion symbol
Submitted: 2019-10-14 09:28 UTC Modified: 2019-10-14 14:44 UTC
From: thb at metanet dot ch Assigned: cmb (profile)
Status: Not a bug Package: idn (PECL)
PHP Version: 7.3.10 OS: LINUX
Private report: No CVE-ID: None
 [2019-10-14 09:28 UTC] thb at metanet dot ch
Description:
------------
If a domain name decodes to something having a lion symbol in front of the result string, idn-to-utf8 fails to decode it. This was not the case in PHP 7.3.9 and is not the case with deprecated INTL_IDNA_VARIANT_2003 .

Test script:
---------------
$string = 'xn--sindmiregal-6o08j.ws';
$idnaInfo = [];
$decoded = idn_to_utf8($string, 0, INTL_IDNA_VARIANT_UTS46, $idnaInfo);
if ($decoded === false) {
    echo 'Test failed.'.PHP_EOL.PHP_EOL;
    var_dump($idnaInfo);
} else {
    echo 'Test was ok.'.PHP_EOL;
}
exit;


Expected result:
----------------
Test was ok.

Actual result:
--------------
Test failed. array(3) { ["result"]=> string(27) "xn--sindmiregal-6o08j�.ws" ["isTransitionalDifferent"]=> bool(false) ["errors"]=> int(1024) } 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-14 11:04 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2019-10-14 11:04 UTC] cmb@php.net
Hmm, can't reproduce on <https://3v4l.org/GPkk2>.  This might be
an ICU issue.  Which version do you use (see phpinfo)?
 [2019-10-14 12:16 UTC] thb at metanet dot ch
ICU Version = 50.1.2
 [2019-10-14 13:06 UTC] cmb@php.net
Thanks!  Is it 50.1.2 for *both* 7.3.9 and 7.3.10?
 [2019-10-14 14:33 UTC] thb at metanet dot ch
for the PHP-7.3.9 instance (another PC) it is

    ICU Version : 63.1 


(... interesting...)
 [2019-10-14 14:44 UTC] cmb@php.net
-Status: Feedback +Status: Not a bug
 [2019-10-14 14:44 UTC] cmb@php.net
Thanks!  Looks like the issue is caused by the rather old ICU
50.1.2 (released 2012-12-17).  I'm closing this ticket as not a
bug.
 [2019-10-14 15:04 UTC] thb at metanet dot ch
okay, that was a very valuable hint.
Thank you very much!
I suggest closing this Bug report.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Nov 27 06:03:14 2021 UTC