Author Topic: Truncate file name (attach) in russian.  (Read 8255 times)

Offline solomin

  • Newbie
  • *
  • Posts: 6
Truncate file name (attach) in russian.
« on: November 10, 2008, 01:10:08 AM »
actual to 0.2 beta & svn 2044
1. attach files to message.
2. send message
3. open Sent folder.
File name consist 11 character in Russian and no more....

its like http://trac.roundcube.net/ticket/1485267
apache-2.2.3-11
php-5.2.5

in svn version with parameter
$rcmail_config['mime_param_folding'] = 2;
filename seems like
?.
« Last Edit: November 10, 2008, 02:12:38 AM by solomin »

Offline solomin

  • Newbie
  • *
  • Posts: 6
Truncate file name (attach) in russian.
« Reply #1 on: November 10, 2008, 04:33:07 AM »
wrong tests
« Last Edit: November 11, 2008, 02:51:52 AM by solomin »

Offline solomin

  • Newbie
  • *
  • Posts: 6
Truncate file name (attach) in russian.
« Reply #2 on: November 10, 2008, 10:34:41 PM »
Nothing Helps.
How to change the coding of a name of a file?
For example, now filenames seems like:

Content-Transfer-Encoding: base64
Content-Type: application/msword application/msword;
 name="=?UTF-8?Q?=D0=9F=D1=80=D0=B8=D0=B3=D0=BB=D0=B0=D1=88=D0=B5=D0=BD=D0.doc?=";
Content-Disposition: attachment;
filename*0*="UTF-8''%D0%9F%D1%80%D0%B8%D0%B3%D0%BB%D0%B0%D1%88%D0%B5%D0%BD"

with next changes:
filename*0*="cp1251''%D0%9F%D1%80%D0%B8%D0%B3%D0%BB%D0%B0%D1%88%D0%B5%D0%BD"
or
filename*0*="koi8-r''%D0%9F%D1%80%D0%B8%D0%B3%D0%BB%D0%B0%D1%88%D0%B5%D0%BD"
« Last Edit: November 10, 2008, 10:38:14 PM by solomin »

Offline solomin

  • Newbie
  • *
  • Posts: 6
Truncate file name (attach) in russian.
« Reply #3 on: November 11, 2008, 02:50:03 AM »
with these chenges:
mime.php:
--- mime.php.old        2008-11-10 13:22:15.000000000 +0500
+++ mime.php    2008-11-11 11:46:41.000000000 +0500
@@ -358,13 +358,13 @@
         if (PEAR::isError($filedata)) {
             return $filedata;
         }
-
+        $filename = iconv('UTF-8', 'cp866', $filename);
         $this->_parts[] = array(
                                 'body'        => $filedata,
                                 'name'        => $filename,
                                 'c_type'      => $c_type,
                                 'encoding'    => $encoding,
-                                'charset'     => $charset,
+                                'charset'     => 'cp866',
                                 'language'    => $language,
                                 'location'    => $location,
                                 'disposition' => $disposition,

and config parameter:
$rcmail_config['mime_param_folding'] = 2;

attachments winth russian names shown correctly (cutted name with correct file extention) in following clients:
RoundCube 0.2, Mozilla Thunderbird, Outlook Express