<<< Date Index >>>     <<< Thread Index >>>

Re: Message-hook problem



* Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx> [2007-08-20 09:50 -0600]:


Aha! :)

It's pretty obvious when you think about it. Let me guess, you use a UTF-8 locale?

Yep.

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)

Ah. Very clear. Thanks.
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.)

Yeah. OS X here doesn't have gsed. Time to hit the books.

Breen
--
Breen Mullins
Menlo Park, California