Writings Photos Code Contact Resume Me
Mutt + Broken HTML emails.
Submitted by msameer on Sat, 22/07/2006 - 4:39pm.

I always had a problem with Arabic HTML emails. They don't specify the encoding.

I'm using mutt (Yes!) as my mail reader. HTML emails can be handled using lynx and a mailcap entry like this:

text/html; /usr/bin/lynx -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html 

The problem is that the HTML fragment in the email doesnt specify the encoding (or whatever the reason is). lynx always assumed an incorrect encoding (iso/cp1252 or whatever). I have no problem reading such emails by viewing the plain text part but It breaks when I reply to people.

The solution is to simply force lynx to use utf8

text/html; /usr/bin/lynx -assume_charset=utf8 -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html 

Happy mutting!

Syndicate content  digg  bookmark

Submitted by Al-Basha (not verified) on Mon, 24/07/2006 - 8:16am.

Interesting - i always thought that most email clients included a mail header stating that the email is encoded using UTF-8.

Is this an auto-generated email? As in something from a listserv or an arabic website?

Al-Basha

Submitted by msameer on Mon, 24/07/2006 - 9:31am.

I discovered later that the header is there but lynx gets an HTML fragment which doesn't specify a header.

Submitted by Anonymous (not verified) on Thu, 10/08/2006 - 2:43am.

Hi Mohammad, just wondering, when you say reading email you mean in console? or in a terminal like xterm? or mlterm, since it supports Arabic??

Submitted by msameer on Thu, 10/08/2006 - 9:18am.

I'm using mutt and mlterm under Debian.

Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <b> <dd> <dl> <dt> <i> <s> <li> <ol> <u> <ul> <br> <br />
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use BBCode tags in the text, URLs will automatically be converted to links.
  • Lines and paragraphs break automatically.
  • You may write mixed Arabic and English freely, line direction will be computed automaticaly

More information about formatting options