Writings Photos Code Contact Resume
Mutt + Broken HTML emails.

You are here

Submitted by msameer on Sat, 22/07/2006 - 2: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!


Submitted by Al-Basha (not verified) on Mon, 24/07/2006 - 6: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?


Submitted by msameer on Mon, 24/07/2006 - 7: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 - 12: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 - 7:18am

I'm using mutt and mlterm under Debian.

Add new comment

Subscribe to /  digg  bookmark