Quote from: goldsky at Jun 08, 2010, 10:53 PM
@fixedmachine,
Looks like the Zaż word is very special, since I can not zip it back with my WinRar.
You know what? Even PHP (encoding==’none’) 271 : Could not delete files.
That’s really weird. I can pack it with my WinRar and any other packers without problems. I don’t know why should that letter generate any special problems. In the version I send you there was only problems with some files with "ż" in the file name inside zip. With the same file uploaded normally (not in zip) everything was fine. But even if there was a file with "ż" letter in its name - when "ż" was on further position everything was fine. Weird? I can bet, that the problem lies inside ZipArchive class.
But now after installing the newest version of e2g from svn (r190) I see that we have additional problems
Goldsky, you can’t rely on mb_detect_encoding. Sometimes it could return false, and we end up with error:
Warning: Argument 2 passed to UTF8::convert_to() must be an string, boolean given, called in /home/domains/domain.net/public_html/assets/modules/easy2/includes/classes/e2g.public.class.php on line 58 and defined in /home/domains/domain.net/public_html/assets/modules/easy2/includes/UTF8-2.1.0/UTF8.php on line 1546 in /home/domains/domain.net/public_html/assets/modules/easy2/includes/UTF8-2.1.0/ReflectionTypehint.php on line 70
So in e2g.public.class.php we can’t have:
<?php> // highlighting
$converted_text = UTF8::convert_to($text,mb_detect_encoding($text));
Anyway. We’ve got a mess with encoding. There is too much ’e2g_decode’ and ’e2g_encode’ where we don’t need it.
We need to rebuild that functionality.
I think that the general procedure should look like this:
1. UPLOAD - we detect encoding of uploaded file name and if it’s different than UTF-8 -> convert it to UTF-8.
2. SAVE - save file with UTF-8 encoded file name
3. DISPLAY - because we know that our file name could contain non-ASCII characters we must URI encode all paths to them (
http://www.w3.org/International/O-URL-code.html)
This is the base. Of course we need to consider synchronization and downloading(zip).
Did I miss something?
I’ll try to fix that things.