bugMHonArc - Bugs: bug #14704, HTML mail does not get its charset...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #14704: HTML mail does not get its charset converted (patch included)

Submitted by:  Boris Smirnov <bsmirnov>
Submitted on:  Tue 04 Oct 2005 08:45:57 AM UTC  
 
Category: Mail ParsingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Behavior
Status: FixedPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Operating System: AllPerl Version: 5.8.7
Component Version: 2.6.15Fixed Release: 2.6.16

Tue 20 Dec 2005 08:55:57 PM UTC, comment #3:

Thanks for spotting my typo. Fix has been checked into CVS.

Earl Hood <ehood>
Project Administrator
Mon 10 Oct 2005 10:52:30 AM UTC, comment #2:

oops, i forgot, that code is not allowed in comments
see comment.txt attached...

Boris Smirnov <bsmirnov>
Mon 10 Oct 2005 10:47:13 AM UTC, comment #1:

1. look for patch in the attachment, not in the message body
2. not included in the patch, but i changed the regexp m/(<meta\s+http-equiv\s=\s['"]?content-type\b[^>]*>)/xi
to
m/(<meta(?:\s+[^>])?\s+http-equiv\s=\s['"]?content-type\b[^>]>)/xi
to handle the header:
<META content="text/html; charset=koi8-r" http-equiv=Content-Type>
that is generated by
<META content="MSHTML 5.00.3831.1800" name=GENERATOR>

Boris Smirnov <bsmirnov>
Tue 04 Oct 2005 08:45:57 AM UTC, original submission:

When text/html part of a message is being archived, and is in a charset different then charset of the archive, it is placed on a message page without charset conversion.
Example: when TextEncode is "cp1251;MHonArc::Encode::from_to;MHonArc/Encode.pm" or
"utf-8; MHonArc::UTF8::to_utf8; MHonArc/UTF8.pm", and HTML part is in koi8-r charset. The character set conversion does not happen.

Here is the fix:

--- readmail.pl.orig 2005-10-04 14:42:17.762886100 +0600
+++ readmail.pl 2005-10-04 14:43:00.701769100 +0600
@@ -1372,7 +1372,7 @@
# If HTML, check <meta http-equiv=content-type> tag since it
# can be different than what is specified in the entity header.
if (($subtype eq 'html' || $subtype eq 'x-html') &&
- ($body =~ m/(<meta\s+http-equiv\s=\s['"]?
+ ($$body =~ m/(<meta\s+http-equiv\s=\s['"]?
content-type\b[^>]*>)/xi)) {
my $meta = $1;
if ($meta =~ m/\bcharset\s=\s['"]?([\w\.\-]+)/i) {

Boris Smirnov <bsmirnov>

 

Attached Files
file #2954:  comment.txt added by bsmirnov (388B - text/plain - file with code from the first comment)
file #2971:  patch added by bsmirnov (525B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by Beuc (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 22 Dec 2008 03:37:07 PM UTCBeucDiscussion LockUnlocked=>Locked
    Sat 10 Jun 2006 02:53:12 AM UTCehoodStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseCVS=>2.6.16
    Tue 20 Dec 2005 08:55:57 PM UTCehoodStatusNone=>Ready For Test
      Fixed Release=>CVS
    Mon 10 Oct 2005 10:52:30 AM UTCbsmirnovAttached File-=>Added comment.txt, #3035
    Tue 04 Oct 2005 08:48:55 AM UTCbsmirnovAttached File-=>Added patch, #3020

    Back to the top


    Powered by Savane 3.1-cleanup1