It looks like the file name encoding is in ISO Latin 1, but the page is interpreted by default using UTF-8. Characters do not appear as βquestion marks,β but as Unicode () replacement characters. This means that a browser that attempts to interpret the byte stream as UTF-8 encounters a byte invalid in UTF-8 and instead inserts a character at that point. Switch your browser to ISO Latin 1 and see the difference (View> Encoding> ...).
So, you need to convert strings from ISO Latin 1 to UTF-8, if you indicated that your page is encoded in UTF-8 encoding. Use mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1') for this.
Why this works, if you specify the encoding $from as pass , I can only guess. What you say mb_convert_encoding is to convert from pass to UTF-8. I believe that mb_convert_encoding takes the value mb_internal_encoding as the $from encoding, which is ISO Latin 1. I assume that it is equivalent to 'auto' when using $from as the parameter.
source share