php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73443 idn_to_ascii wrong returned value with ß
Submitted: 2016-11-02 14:09 UTC Modified: 2016-11-02 18:36 UTC
From: stevedoerre at googlemail dot com Assigned:
Status: Not a bug Package: intl (PECL)
PHP Version: 5.6.27 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: stevedoerre at googlemail dot com
New email:
PHP Version: OS:

 

 [2016-11-02 14:09 UTC] stevedoerre at googlemail dot com
Description:
------------
---
From manual page: http://www.php.net/function.idn-to-ascii
---


Test script:
---------------
<?
echo idn_to_ascii("buchgroßhandel.de");
?>

Expected result:
----------------
xn--buchgrohandel-hdb.de

Actual result:
--------------
buchgrosshandel.de

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-02 18:36 UTC] requinix@php.net
-Summary: idn_to_ascii wrong returned value +Summary: idn_to_ascii wrong returned value with ß -Status: Open +Status: Not a bug -Type: Documentation Problem +Type: Bug -Package: Scripting Engine problem +Package: intl
 [2016-11-02 18:36 UTC] requinix@php.net
ß is a tricky case: IDNA 2003 had the character be converted to "ss" while IDNA 2008 fixes it. To resolve the confusion UTS#46 was created that basically says to keep using the old behavior. That means if you try your domain in a browser today you'll probably see it silently convert to "ss"; a few WHOIS services I tried also interpreted my request as one for the "ss" version, and apparently some registrars require clients to register both the ß- and ss-versions of domain names.

Here's one of many people talking about it:
https://blogs.msdn.microsoft.com/shawnste/2010/12/08/idna-is-it-fussball-or-fuball/

So basically the default behavior for just about everybody should be to accept "ss" as the default conversion.

The good news is that PHP has both options available. Check the documentation, then use the IDNA_NONTRANSITIONAL_TO_ASCII $options and the INTL_IDNA_VARIANT_UTS46 $variant.
https://3v4l.org/dGENe
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 17:01:30 2024 UTC