Like bug reported in http://drupal.org/node/755578, attachments private downloads in Internet Explorer fails to show and save the correct filename when this filename uses UTF-8 characters. I solve this issue with similar code show in the previous report:
Changing line 195 and 196 in filefield.module:
$name = mime_header_encode($file->filename);
$type = mime_header_encode($file->filemime);
to:
if ( eregi("MSIE", getenv( "HTTP_USER_AGENT" )) || eregi("Internet Explorer", getenv("HTTP_USER_AGENT" ))) {
$name = mb_convert_encoding($file->filename,"ISO-8859-1","UTF-8") ;
$type = mb_convert_encoding($file->filemime,"ISO-8859-1","UTF-8") ;
}
else {
$name = mime_header_encode($file->filename);
$type = mime_header_encode($file->filemime);
}
Comments
Comment #1
quicksketchI'd strongly suggest you avoid the problem entirely by installing Transliteration.
Comment #2
alambike CreditAttribution: alambike commentedThanks for the advice but it's too late for me! Our site has hundreds of files with UTF-8 filenames and I can't change this. Maybe some day IE fixes this bug (XD), but while this works for me. Anyway us-ascii does not fit all.
Comment #3
quicksketchI'm moving this issue to postponed as it seems a little obscure. I'd love some additional feedback on the approach used here, because I can't seem to find very much instruction about how to properly handle this (other than the other issue alambike linked to already). As I don't use IE regularly and I always use Transliteration, this particular problem is not one that I run across.
Comment #4
quicksketchWell a year later, I'm still not interested in implementing this. Moving to won't fix.