ID: 46456 Updated by: [EMAIL PROTECTED] Reported By: mkurpel at gmail dot com Status: Bogus Bug Type: Zip Related Operating System: FreeBSD 6.2-RELEASE-p8 PHP Version: 5.2.6 Assigned To: pajoye New Comment:
Zip supports UTF-8 if some specific flag is set. But 99.999% of the time, the strings are stored as is, without any conversion (by many tools). Previous Comments: ------------------------------------------------------------------------ [2008-11-04 14:44:22] mkurpel at gmail dot com Can you tell me what encoding does the zip format use? Maybe I could use iconv then... it must be possible somehow since the national chars are all okay when reopening the zip file in winrar. ------------------------------------------------------------------------ [2008-11-04 14:21:46] [EMAIL PROTECTED] > Be sure to save it as ANSI (so we are not messing with utf-8 now). Thing is Zip does not convert anything, it gives you what the zip entry contains. If the console or your html page are not using the same encoding, then it is likely to be displayed badly. ------------------------------------------------------------------------ [2008-11-04 14:19:39] mkurpel at gmail dot com My god, the string got converted to html entities again :-/ ------------------------------------------------------------------------ [2008-11-04 14:18:32] mkurpel at gmail dot com I tried the same script as pajoye sent here. Only added a second line with original filename for comparison: <?php $somezipfile = '46456.zip'; $zip = zip_open(realpath($somezipfile)); while ($zip_entry = zip_read($zip)) { echo zip_entry_name($zip_entry); } zip_close($zip); ?> <br> ľčťýáíéúôňäóěďřĺöëü ĽČŤÝÁÍÉÚÔŇÄÓĚĎŘĹÖËÜ.xls Be sure to save it as ANSI (so we are not messing with utf-8 now). What it outputs is: http://obrazok.eu/files/79gro4t39dzzzr3mk6u7.png The strings should be the same. I do not think what it outputs is okay. ------------------------------------------------------------------------ [2008-11-04 13:08:54] [EMAIL PROTECTED] Here is a screen shot: http://pierre.libgd.org/zip/46456.png the console output uses the script below, the GUI is Winrar (same with Winzip or windows compressed folder). <?php $somezipfile = '46456.zip'; $zip = zip_open(realpath($somezipfile)); while ($zip_entry = zip_read($zip)) { echo zip_entry_name($zip_entry); } zip_close($zip); There is no difference, no bug > bogus. As Derick said earlier, you are messing with the encoding and try to encode something that it is already UTF-8. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/46456 -- Edit this bug report at http://bugs.php.net/?id=46456&edit=1