Re: Message-hook problem
- To: mutt-users@xxxxxxxx
- Subject: Re: Message-hook problem
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Mon, 20 Aug 2007 09:50:11 -0600
- Comment: DomainKeys? See http://domainkeys.sourceforge.net/
- Dkim-signature: v=0.5; a=rsa-sha1; c=relaxed; d=memoryhole.net; h=received:received:date:from:to:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; q=dns/txt; s=default; bh=YnMql7+PXKEnX7zLjDylb/UOlag=; b=P9nJ1zG4ty4dwPUYQ5+w6ZrGTrdV6VaXeJorkeHtjcmoW8/eJyVAlGQE3OZFOA4yocrRfpu1lGPqht24u2LIKvqNxJwjQ+TQpris8GK/dJx15b1MCBLIk8CvI22kj4t2XkxA2Ttcxkx4MrDXllH9PPjBjVwVIa8aapIfqQysWfA=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=RUKAP4DenIFMZlajywJFX5Hf1HCAIqS3YihMj3DBSrSvIfq1bwdFIBnWKArXf3Eb+PqIeGxC6DFAOUrM+JdcYsU/Qyi+GGi3nc2tVsKldB9r2lZlRPiHZeRA/LCvAz4h4Bqfe+DlVMy53PuFtRqeFsiDS6ij8R6RgoHmu79XbJM=; h=Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent;
- In-reply-to: <20070820144025.GH3522@xxxxxxxxxxxxxxxxxxxxx>
- List-post: <mailto:mutt-users@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-users"
- Mail-followup-to: mutt-users@xxxxxxxx
- References: <20070819194146.GB3522@xxxxxxxxxxxxxxxxxxxxx> <20070820134221.GD13721@xxxxxxxxxxxxx> <20070820144025.GH3522@xxxxxxxxxxxxxxxxxxxxx>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.16 (2007-07-25)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday, August 20 at 07:40 AM, quoth Breen Mullins:
> * Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx> [2007-08-20 07:42
> -0600]:
>
>> On Sunday, August 19 at 12:41 PM, quoth Breen Mullins:
>>> I've wrestled with this one for a few days and I'm not getting
>>> anywhere.
>>> It should be simple (and probably is!) but I'm not seeing it.
>>
>> Could you post an example message so that we can examine it?
>
> Sure. Here's a trimmed version, full thing available too.
> (I'm pretty sure I've got everything relevant...)
Aha! :)
It's pretty obvious when you think about it. Let me guess, you use a
UTF-8 locale?
Mutt is converting the characters to be displayed (the 0xB9 in
ISO-8859-1, which means a superscript 1) into the displayable
characters (UTF-8). Thus the 0xB9 byte gets translated into 0xC2 0xB9,
because that's what superscript-one is in UTF-8 (you notice how it's
still got an 0xB9 in there?). The tr program, knowing only bytes,
finds the 0xB9 byte and transforms it into 0x27, just like you told it
to, leaving 0xC2 0x27. Because 0x27 does not fit the form 10zzzzzz,
this is an invalid UTF-8 character, and so Mutt does its best to show
it to you. (0xC2 == \302)
The tr program, unfortunately, does not understand UTF-8, so there's
no truly "correct" way to use it to fix this problem. You can use this
command:
tr -s '\302\271' '\47'
And that will give you the correct output for this message, but will
corrupt other messages that use UTF-8 characters also beginning with
0xC2. The best way to fix this is with sed, rather than tr:
sed "s/\o302\o271/'/g"
(That's for GNU sed; other sed's use different syntax for specifying
bytes.)
~Kyle
- --
These are the times that try men's souls. The summer soldier and the
sunshine patriot will, in this crisis, shrink from the service of
their country; but he that stands it now, deserves the love and thanks
of man and woman.
-- Thomas Paine
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iD8DBQFGybgzBkIOoMqOI14RAr9FAJ4j/zmFgeS9B6zSjtsu00R68/6ZrACgmVyn
Lrv3Pggc0Dn/1p1qYAGQqHA=
=8XeJ
-----END PGP SIGNATURE-----