1

[UPD]:

I've just double-checked. It behaves this way under Nginx 1.17 only. Apache works fine!

The code:

$url = '/Регистрация/?lala=123';
$res = parse_url($url);
echo '<pre>';
print_r($res);
echo '</pre>';

Under Apache everything works fine. Under Nginx 1.17 it looks like below.

enter image description here

Any ideas?

  • @Jeto hmmm... Yes... But not in my Open Server environment. Nginx 1.17... – Vsevolod Azovsky Dec 13 '19 at 17:53
  • 3
    Hm, indeed the UTF-8 characters seem to be badly handled in some cases (on my local Apache on PHP 7.1.9 for instance). Try [this function](https://bedigit.com/blog/php-parse_url-function-for-multibyte-character-encodings/) instead. – Jeto Dec 13 '19 at 18:01
  • I've updated the question. THe deal is in Nginx – Vsevolod Azovsky Dec 13 '19 at 18:05

1 Answers1

1

There is a known and still not fixed bug in PHP: https://bugs.php.net/bug.php?id=52923

Basically the function has never worked properly with UTF8. You can try alternative options, for example what was already proposed in comments

Dmitrii Tarasov
  • 414
  • 2
  • 13
  • Dima, thanks, man! ))) The weirdest thing here, that bug has disappeared after I've moved everything to another comp. I've simply made the exact copy of OpenServer folder with all same settings (!!!)... The only difference: previous system is Windows 10 Enterprise, the current one is Windows 10 Professional. I definitely investigate the function you mention. To be continued... – Vsevolod Azovsky Dec 16 '19 at 12:43