Web lists-archives.com

Re: [PHP] parse_url and the charsets ...




On Thu, Jan 14, 2016 at 9:06 AM, Simon Schick <simonsimcity@xxxxxxxxx> wrote:
> Hi, all
>
> I lately ran into the issue, that the method parse_url() does not give
> the expected result if you pass in a URL like "http://localhost/2 -
> English title 2 (fi) здесь.mp3?download=1".
>
> Here is the code I tried:
>
> var_dump(parse_url("http://localhost/2 - English title 2 (fi)
> здесь.mp3?download=1"));
>
> And here is the result I got when running it on my local machine:
>
> array(4) {
>   ["scheme"]=>
>   string(4) "http"
>   ["host"]=>
>   string(9) "localhost"
>   ["path"]=>
>   string(41) "/2 - English title 2 (?_) зде?_?_.mp3"
>   ["query"]=>
>   string(10) "download=1"
> }
>
> But I more expected to get a result like this:
>
> array(4) {
>   ["scheme"]=>
>   string(4) "http"
>   ["host"]=>
>   string(9) "localhost"
>   ["path"]=>
>   string(41) "/2 - English title 2 (fi) здесь.mp3"
>   ["query"]=>
>   string(10) "download=1"
> }
>
> What setting in PHP is the one being responsible for this change?
> Because I saw it working in every PHP version on 3v4l: https://3v4l.org/5hXSH
>
> Bye,
> Simon

There were already two bug-reports related to this:

* https://bugs.php.net/bug.php?id=52923
* https://bugs.php.net/bug.php?id=68296

I added my notes to #52923 and linked both together.

Bye,
Simon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php