I use ZipArchive(); to list the file names inside a Zip archive (uploaded on FTP by different users, not created by server).
Problem is that some of the file names contain french caracters (accents like é à ô â à è) that are not displayed proprely. Instead i get a "�" symbol.
The page is encoded in utf8 and the rest of the script doesnt have any problem with accents
i tried running htmlentities() or utf8_encode() on $toune but it didnt help...
here's my code:
header('Content-Type: text/html; charset=utf-8');
$downloadlink = "pp/86 Crew - 2000 - Bad Bad Reggae.zip";
$za = new ZipArchive();
$za->open($downloadlink);
for( $i = 0; $i < $za->numFiles; $i++ ){
$stat = $za->statIndex( $i );
$tounes = array( basename( $stat['name'] ) . PHP_EOL );
foreach($tounes as $toune) {
echo $toune;
}
}