Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78092 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65625 invoked from network); 15 Oct 2014 08:41:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2014 08:41:55 -0000 Authentication-Results: pb1.pair.com header.from=dunglas@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dunglas@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: dunglas@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:63586] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C6/61-57986-1533E345 for ; Wed, 15 Oct 2014 04:41:53 -0400 Received: by mail-wi0-f182.google.com with SMTP id n3so1182819wiv.15 for ; Wed, 15 Oct 2014 01:41:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=8oBewwlj9UY2XQYFUNj/OZnG4Gdr0SdXaY+FPsMf23k=; b=NETYQy+JKVpc5huM5Z3sfQrvmLcnp3YhAXuUWYhkAjvriAGBy2JZWjMQg3DDI5HDpT sYrxfLFSwiklsdhAS0KlX5LH8ordLjegi6mSaXpfyOo8E5D5tDVdyoShmPWZMho+2xGi uk9S+8uBR9i7ny/rcLK5cCep9gXCuzJgnryunbpUPSbnsmYwd6+8JA1Z5oTGPktCknM2 0Aq8p5MlbETmB5dcYZVuAIcIJGcurs8QitljiLPrROjw6zDmvJPNArEPHrA5QPDfXTuH nNjagkJpHZKRDOM3T2uE/mdCWM9OLwn2BvZ/Qewotu2d9VdUSiE4IBVayMZfpAf/5ZXL 9g/w== X-Received: by 10.180.219.74 with SMTP id pm10mr10917221wic.22.1413362510640; Wed, 15 Oct 2014 01:41:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.195.18.65 with HTTP; Wed, 15 Oct 2014 01:41:30 -0700 (PDT) In-Reply-To: References: <542214E2.5050800@sugarcrm.com> Date: Wed, 15 Oct 2014 10:41:30 +0200 Message-ID: To: Chris Wright Cc: Pierre Joye , Stas Malyshev , PHP internals Content-Type: multipart/alternative; boundary=001a1134c7b262bd280505721a5e Subject: Re: [PHP-DEV] Internationalized Domain Name support in FILTER_VALIDATE_URL From: dunglas@gmail.com (=?UTF-8?Q?K=C3=A9vin_Dunglas?=) --001a1134c7b262bd280505721a5e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Chris, I've just blogged about IDN support in PHP. This post include a (tiny) userland implementation of streams: http://dunglas.fr/2014/10/internationalized-domain-name-idn-and-php/ What do you think about the following to add native support : 1. As already stated, make ICU a dependency of core 2. Convert the host returned by php_parse_url here https://github.com/php/php-src/blob/master/ext/standard/http_fopen_wrapper.= c#L154 to Punycode with http://icu-project.org/apiref/icu4c432/uidna_8h.html#a711fa1d2e6dd25d7368f5= b3ea2aaedc6 It looks not so intrusive and relatively easy to implement. According to RFC I quote in the blog post, it should work with SSL too. I can make a PR (or a RFC if needed) with this method if it seems applicable. Best regards, 2014-09-24 8:33 GMT+02:00 Pierre Joye : > On Wed, Sep 24, 2014 at 2:48 AM, Stas Malyshev > wrote: > > Hi! > > > >> I'll implement optional (and not default) support of IDN in > filter_var(). > >> > >> Does anyone known if it's better to use libIDN (LGPL) or ICU (custom > >> license deviated from the X license) from a license point of view? > > > > ICU is definitely better since we already have a lot of code using ICU > > and AFAIK our current IDN functions (idn_to_*) use ICU. Which means it > > would be advantageous to keep it in the single library - whatever bugs > > there may be, at least the user will be dealing with one set of bugs > > instead of two :) > > Indeed :) > > However I am not sure yet we should do it, or at least not by default. > It may introduce side effects or BC issues.While IDN is bi-directional > or could be called many times and returning the same result, we have > to be careful to do not break things out there, for example someone > relying on it to process URI/URL. > > Cheers, > -- > Pierre > > @pierrejoye | http://www.libgd.org > --=20 K=C3=A9vin Dunglas Consultant et d=C3=A9veloppeur freelance http://dunglas.fr T=C3=A9l. : 06 60 91 20 20 --001a1134c7b262bd280505721a5e--