ID: 46456 Updated by: [EMAIL PROTECTED] Reported By: mkurpel at gmail dot com -Status: Open +Status: Feedback Bug Type: Zip Related Operating System: FreeBSD 6.2-RELEASE-p8 PHP Version: 5.2.6 New Comment:
First of all, don't use utf8_encode... does it work then? Previous Comments: ------------------------------------------------------------------------ [2008-11-01 17:33:51] mkurpel at gmail dot com The characters in Actual results got converted into html entities in this bug tracking system. The script has output actual characters, not entities. ------------------------------------------------------------------------ [2008-11-01 17:31:52] mkurpel at gmail dot com Description: ------------ I am reading a ZIP file containing one XLS file named "µ¹è»¾ýáíéúôòäóìïøåöëü ¥©È«®ÝÁÍÉÚÔÒÄÓÌÏØÅÖËÜ.xls". However, I am getting mangled characters from the zip_entry_name() function. I am working in UTF-8 so I utf_8_encoded it prior to echoing. All my php files are saved in utf-8 too. Non-national characters are returned just fine. Reproduce code: --------------- header('Content-Type: text/html; charset: utf-8'); setlocale(LC_ALL, 'sk_SK.utf8'); mb_internal_encoding('UTF-8'); mb_http_output('UTF-8'); $zip = zip_open(realpath($somezipfile)); while ($zip_entry = @zip_read($zip)) { echo $path = utf8_encode(zip_entry_name($zip_entry)); } @zip_close($zip); Expected result: ---------------- should echo this string: µ¹è»¾ýáíéúôòäóìïøåöëü ¥©È«®ÝÁÍÉÚÔÒÄÓÌÏØÅÖËÜ.xls Actual result: -------------- echoed this string: –矜§ì ¡‚£“å„¢ØÔý’”‰ •欛¦íµÖéâÕŽà·Òü‘™Óš.xls ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46456&edit=1