#93 Support for IDN (Internationalized Domain Names)

Core (30)

Support for Internationalized Domain Names (IDN) in some future version would be nice.
I don't know how hard this would be to implement.
This would be a welcome feature to some users who use country specific chars in their domain name.


  • Benny Pedersen

    Benny Pedersen - 2015-07-02

    is there a progress status on this ?

    if php supports idn its imho relative easy ?

  • Victor Litvin

    Victor Litvin - 2016-05-12

    Here is my workaround for local installation of 2.93:
    in ./functions.inc.php change line 201:

    <     if (!preg_match ('/^([-0-9A-Z]+\.)+' . '([0-9A-Z]){2,13}$/i', ($domain))) {
    >     if (!preg_match ('/^([-0-9A-Z]+\.)+' . '([-0-9A-Z]){2,13}$/i', ($domain))) {

    This adds "-" as valid symbol in top-level domain.
    So you can add idn domain in it's punycode form and pass this check. Then it's inserted in db also in punycode form.
    As i'm aware MUA converts domain part to punycode, so no changes on MTA side should be done.

    As for proper implementation, I suppose, all domains should be treated as idn and get converted to punicode and stored in such form. And for display perposes converted back.

  • Christian Boltz

    Christian Boltz - 2016-05-15

    Do you have an example of a top level domain that includes punicode or a -?

    I'm aware that (second-level) domains can contain non-ascii chars, but until now I never heard of a non-ascii top level domain. However, with the evergrowing pile of new top level domains, I won't be too surprised if you can name one ;-) (BTW: The lenght limit (up to 13 chars for the top level domain) also grew with the new TLDs.)

    That said - AFAIK the MUA and MTA always use the punicode form. MUAs might translate "between" punicode and the human-readable version in their user interface ("might" because I slightly ;-) doubt that all mail clients do it).

  • Victor Litvin

    Victor Litvin - 2016-05-16

    1) Yeah, I have domain тсс47.рф (russian idn) <-> xn--47-nmcad.xn--p1ai (punycode).
    Basically all new russian domains will have top domain .xn--p1ai and all punycode strings will start with "xn--"

    2) All non-ASCII will be subject to translate in punycode form. So, only ASCII characters will be left.

    3) And there is RFC 5336 (https://tools.ietf.org/html/rfc5336 ) but it seems that it's not implemented in MUA's. So no internalization in local part of email address yet.

  • Christian Boltz

    Christian Boltz - 2016-05-16

    Thanks for the information. I wasn't aware of this, but maybe I'm just too german to know about such things happening in russia ;-)

    Fixed in SVN trunk r1839.

    I'll keep this feature request open because the "display human-readable version of IDNs" is still missing.

    Implementing this became easier in the meantime because PHP >= 5.3 has the idn_to_utf8() function (typically hidden in the php5-intl package).


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks