Handle special characters correctly

I fixed a problem I encountered on windows apache/PHP server: Special
characters (like é) in files and folders are not handled correctly.
Running scandir() on a windows system returns files and folder names in
WINDOWS-1252 encoding, which does NOT work when calling htmlentities()
over them for these kind of special characters. Therefor the encoding is
converted to UTF-8 which works correctly with htmlentities().