Moving to PHP 7.1+ in Windows, utf-8 files names need to be converted

[email protected] ("Zen-Do.Ru") Wed, 7 Feb 2018 12:05:29 +0300
Newsgroups php.i18n
Message-ID <[email protected]>
Greetings, fellows!

Please help.

There are web engines which save file names in utf-8, in particular 
DokuWiki.

In Windows it resulted in names like "кулинария.txt"

Now with PHP 7.1+ new file names are readable (thank you folks!), but 
the problem is that old file names aren't recognized anymore.

What is the way to read such names in PHP 7.1 and convert them to normal?

For now I came up only with ideas of very complex solutions, like

- with old PHP, read old files and rename them into punycode (as 
percent-encoding might make too long names),

- zip them,

- unzip them in the new server/PHP directory,

- with new PHP, read punycode names and rename files into new UTF-8.

Is it possible just to read old files in PHP 7.1+ in a way like older 
PHP did, and then rename them to new names in one pass?

(Currently it's not trivial, as "code pages" for various names can be 
different, and detecting the encoding automatically can be impossible).

Thank you in advance, any advice would be appreciated!

Just FYI, an issue about that in DokuWiki repository is here:
https://github.com/splitbrain/dokuwiki/issues/2248