1

I have some issues with file name encoding when extended latin characters are used. I have the following files:

Letter Ā.mp4
Letter A.mp4

In any way with different methods in PHP gives me the filenames as the same:

Letter A.mp4
Letter A.mp4

Even iterating over them this name is shown twice, it means that it sees 2 different files.

I tried to change script encoding with mb_internal_encoding("UTF-8"), tried recursive directory iterator, tried glob etc. In no way I cant get PHP to output the full filename with Ā

What file listing method should I use to see those files with illegal names? I want to rename those files without bad characters.

kittykittybangbang
  • 2,380
  • 4
  • 16
  • 27
Pilskalns
  • 350
  • 1
  • 2
  • 15
  • What OS and filesystem are you using? It seems to work fine on Linux and ext4. – Benoit Garret Aug 28 '15 at 13:46
  • Windows server 2008 R2 x64 with huge NTFS for backups. Here is my phpinfo https://jsfiddle.net/jevcrgL1/embedded/result/ , server is not public. – Pilskalns Sep 01 '15 at 14:54
  • Did you try to convert the output from utf16 to utf8? These questions might be related to your problem : http://stackoverflow.com/questions/6634832/file-exists-and-file-get-contents-fail-on-a-file-which-is-named-output-%C3%95%C3%8D%C3%95%C2%A5?lq=1 http://stackoverflow.com/questions/2050973/what-encoding-are-filenames-in-ntfs-stored-as – Benoit Garret Sep 02 '15 at 08:51

0 Answers0