no support for unicode e-mails messages

Bug #407736 reported by Nadav
30
This bug affects 7 people
Affects Status Importance Assigned to Milestone
GMail Notifier
Fix Released
Undecided
Unassigned

Bug Description

When receiving non-English messages, gibberish is shown instead of the message text. It appears to be base64, but I'm not sure.

Revision history for this message
Alexander Hungenberg (alexander-hungenberg-gmail) wrote :

could you please add a screenshot?

Changed in gm-notify:
status: New → Incomplete
Revision history for this message
Nadav (nadavz) wrote :

I sent myself an e-mail in Hebrew, and this is what happened. Iv'e also confirmed that it is indeed showing the base64 encoding of my message.

Revision history for this message
Alexander Hungenberg (alexander-hungenberg-gmail) wrote :

okay, this already was fixed some time ago in trunk...

Changed in gm-notify:
status: Incomplete → Fix Committed
Revision history for this message
Ryou Ohsawa (xr0038) wrote :

hello, I use GMail Notifier v0.9 on Ubuntu 9.10.
this app is very useful. I am pleased to met this notification system. Thanks!

Then, I have the same problem since I receive mails in Japanese.
I have made some modifications on gm-notify.py and get the app to display Japanese charactors

add one module,
++ from email.header import decode_header

and input some lines before cutting the long title.
        # aggregate the titles of the messages... cut the string if longer than 20 chars
        titles = ""
        for title in newmail:
            self.addIndicator(title)
++ if title.find("=?UTF-8?B?")==0:
++ title = decode_header(title).pop()[0]
++ title = title.decode('utf-8')
            if len(title) > 20:
                title = title[0:20] + "..."

at present, it works well.

Revision history for this message
Ryou Ohsawa (xr0038) wrote :

sorry, I find a serious bug. my modification work well only in UTF-8.
the code below might work well for other codings.

 # aggregate the titles of the messages... cut the string if longer than 20 chars
 titles = ""
 for title in newmail:
  self.addIndicator(title)
++ if title.find("=?")==0 & title.find("?=")!=-1:
++ title_str = decode_header(title).pop()[0]
++ title_code = decode_header(title).pop()[1]
++ title = title_str.decode(title_code)
  if len(title) > 20:
   title = title[0:20] + "..."

Revision history for this message
Alexander Hungenberg (alexander-hungenberg-gmail) wrote :

Hi Ryou,
a fix for this bug is already commited to current trunk because it features a completely new backend. Could you please test this version to see if the bug is fixed?

Changed in gm-notify:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.