opendir and readdir returns utf8

Viewed 1241

Why does this return utf8 chars on one server but not on another? Some filenames contain unicode chars like æ ø and å..

In some environments utf8 chars are printed and in some iso chars are printed

header('content-type: text/plain');
$handle = opendir("./dir");
while($readdir = readdir($handle)){
    echo "$readdir\n";
}

output Content-Type:text/plain;charset=UTF-8

Retursvar 2 med fejl p� debiteringsniveau.xml
Retursvar 2 med fejl på debiteringsniveau.xml

The same locales are installed on both systems (UTF8)

dpkg-reconfigure locales
3 Answers
Related