ID:               46456
 User updated by:  mkurpel at gmail dot com
 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:

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.


Previous Comments:
------------------------------------------------------------------------

[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>
&#318;š&#269;&#357;žýáíéúô&#328;äó&#283;&#271;&#345;&#314;öëü
&#317;Š&#268;&#356;ŽÝÁÍÉÚÔ&#327;ÄÓ&#282;&#270;&#344;&#313;ÖËÜ.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.




------------------------------------------------------------------------

[2008-11-03 19:48:11] mkurpel at gmail dot com

You can find the zip file here:
http://kotuha.com/file/zWio7-aaa.html
There is a xls file inside with the filename µ¹è»¾ýáíéúôòäóìïøåöëü
¥©È«®ÝÁÍÉÚÔÒÄÓÌÏØÅÖËÜ.xls and it should display the xls filename exactly
like it is (with national characters).
With the code originally provided it looks like this:
http://obrazok.eu/files/6hhmttlsmiwezc8gmo6m.png
All non-national characters (if there were any in the xls filename) are
retained, national characters get garbled.

------------------------------------------------------------------------

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

Reply via email to