Opened 4 years ago

Last modified 17 months ago

#7791 new defect

[patch] charset="us-ascii" in text part of html announcement

Reported by: g1itch Owned by: doki_pen
Priority: normal Component: AnnouncerPlugin
Severity: trivial Keywords: charset
Cc: jbeilicke Trac Release: 0.12


When I choose the 'text/html' announcement format the first part of multipart/alternative mime has Content-Type: text/plain; charset="us-ascii", but second - Content-Type: text/html; charset="utf-8"

mime_encoding = qp

Why? How can I change this behavior?

The message contains cyrillic characters. Then I choose multiple messages in Thunderbird, it displays something like Приоритет. MS Outlook displays such characters always.

Attachments (0)

Change History (4)

comment:1 Changed 3 years ago by g1itch

Alternative part appears without charset setting:

  • distributors/

    old new  
    490490            alt_msg_format = 'html' in alternate_style and 'html' or 'plain' 
    491491            msgText = MIMEText(alternate_output, alt_msg_format) 
     492            msgText.set_charset(self._charset) 
    492493            parentMessage.attach(msgText) 
    493494        else: 
    494495            parentMessage = rootMessage 

comment:2 Changed 3 years ago by g1itch

  • Severity changed from normal to trivial
  • Summary changed from charset="us-ascii" in text part of html announcement to [patch] charset="us-ascii" in text part of html announcement

comment:3 Changed 3 years ago by jbeilicke

  • Cc jbeilicke added

comment:4 Changed 17 months ago by hasienda

(In [12341]) TracAnnouncer: Apply suitable charset to alternative part of email message as well, refs #7791.

This fixes inappropriate alternative text display of non-ascii characters in
HTML emails, that get sent out as multi-part message in MIME format.

This has been reported by g1itch, who did investigations and patch as well.
Works like a breeze, but this must have been much harder to fix than one would
expect at first glance onto this one-liner. It's a pleasure to follow your
footsteps, thanks a bunch.

Add Comment

Modify Ticket

as new .

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.