Hello,

On Fri, Jun 25, 2010 at 11:31:23PM -0700, George Davidovich wrote:
>  32 Content-Type: text/plain; charset=iso-8859-1
>  33 Content-Transfer-Encoding: quoted-printable
>  34 
>  35 George=A0=A0-=A0=A0 ...
 
> As I understand it, "A0" represents the
> non-breaking space character.

In iso-8859-1? Maybe. If I create this file:
  $ echo -e 'a\xa0b' > /tmp/nbsp
and then
  $ vim /tmp/nbsp
vim shows:
  a b
and
  "/tmp/nbsp" [converted] 1L, 5C
in its status line at the bottom. 
This means that vim converted text to utf8 (my
locale) and "nbsp" character now takes 2 bytes (in
utf8). And the 5th byte is "\n" BTW.

> Mutt displays the message correctly, but in vim,
> the character appears as a pipe symbol.

Please verify that vim can or cannot correctly
handle \xa0 character using the abovementioned
method.

>  And, as you can tell, there's a whole lot of them.

If vim itself works OK but e-mails from mutt still
show a lot of pipes, then, well, mutt really feeds
vim with pipes.

>   2. As a workaround, how do I search/replace
>      non-printable characters
>      in vim?

If you want to perform a substitution
automatically when any file of type "mail" is
opened by vim, then the following snippet in your
~/.vimrc will help:


if has("autocmd")
  " Replace all iso8859-1 nbsp chars with "_"
  autocmd BufReadPost *
  \ if &filetype == "mail" && &fileencoding == "latin1" |
  \   %s/\%xA0/_/g |
  \ endif
endif

-- 
With best regards,
xrgtn (+380501102966/+380636177128/[email protected])

Reply via email to