Fix basename() bug in PHP when dealing with non-ASCII characters