[Tickets #11073] Re: Charset is not set for the "View Source"

bugs at horde.org bugs at horde.org
Tue Mar 13 10:16:44 UTC 2012


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/11073
------------------------------------------------------------------------------
  Ticket             | 11073
  Updated By         | ak at lps.komi.ru
  Summary            | Charset is not set for the "View Source"
  Queue              | IMP
  Version            | Git master
  Type               | Bug
  State              | Not A Bug
  Priority           | 3. High
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


ak at lps.komi.ru (2012-03-13 10:16) wrote:

1)Mime message have content type neither a 'text/plain' nor a  
'text/html', but ussually 'multipart/mixed' and some others. AND this  
patch puts charset only for the content type with a charset inside  
'content type' header, i.e. for 'text/plain' and 'text/html' !
2)If you are sending just text/plain than Apache adds defaultcharset  
itself, as I know
3)User offten cant change charset at the browser  (for exaple me)when  
you are using window without toolbars and menues. Sic!
4)About rare or nor rare cases. Now it is very offten when  
autogenerated mail goes "Content-encoding: 8bit" with not latin1 and  
so on with first 7bit chars. Ask more people from not latin alphabet  
countries.
5)" Save as" is not the best solution, but it works.


>> One more needful thing for non-latin alphabet's users.
>> When there is generates view of "View Source" [actionID=view_source]
>> there is setting of the content type of 'text/plain' without charset.
>> For correctness file /webroot/imp/view.php, lines after 194 should be:
>>
>> case 'view_source':
>>     $msg = $contents->fullMessageText(array('stream' => true));
>>     rewind($msg);
>>     while (!feof($msg)) {
>>         $line=fgets($msg, 4096);
>>         if ($line !== false){
>>             if (strlen($line)==0) break 1;
>>             if (strpos($line ,"charset=")>0 && ($pos=strpos($line
>> ,";"))>0){$ct=substr($line,$pos);break 1;}
>>         }
>>     }
>
> No.  A MIME message could theoretically have a different charset for  
> each part - you can't just choose the first part and use that as the  
> charset.  Additionally, the charset is worthless information since  
> most messages will be encoded in US-ASCII.  The charset parameter of  
> Content-Type deals with the UNencoded data.
>
> To accurately download the contents of a message, you need to use  
> the "Save As" feature.  View Source is not meant to be a canonical  
> representation of the data.






More information about the bugs mailing list