Nginx 1.17 + PHP + Open Server: parse_url with non-English (Russian) characters (letters) leads to wrong characters conversion

347 Views Asked by At

[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?

1

There are 1 best solutions below

1
Dmitrii Tarasov On

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