vim pine problem

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

vim pine problem

Jorge Almeida
This is probably not a vim problem, but I couldn't google my way around
it...
I'm using pine as MUA, with vim as alternate editor. While editing in
vim, accented characters are displayed just fine, but after quitting vim
the accented characters give way to gibberish in pine's editor.
Example: ?? (in vim) --> áç (in pico)
(hope this shows right...)

Note that I can get accented characters in pico. I can also read
received messages containing accented characters in pine. The problem
concerns only messages composed in vim and then "imported" to pico.

Any hint?

--
Jorge Almeida


--
Jorge Almeida
Reply | Threaded
Open this post in threaded view
|

Re: **SPAM** vim pine problem

A.J.Mechelynck
----- Original Message -----
From: "Jorge Almeida" <[hidden email]>
To: <[hidden email]>
Sent: Friday, August 12, 2005 12:41 PM
Subject: **SPAM** vim pine problem


> This is probably not a vim problem, but I couldn't google my way around
> it...
> I'm using pine as MUA, with vim as alternate editor. While editing in
> vim, accented characters are displayed just fine, but after quitting vim
> the accented characters give way to gibberish in pine's editor.
> Example: ?? (in vim) --> áç (in pico)
> (hope this shows right...)
>
> Note that I can get accented characters in pico. I can also read
> received messages containing accented characters in pine. The problem
> concerns only messages composed in vim and then "imported" to pico.
>
> Any hint?
>
> --
> Jorge Almeida
>
>
> --
> Jorge Almeida

Looks like an encoding problem. Are the mail headers available in Vim? Check
that the 'fileencoding' agrees with the second part of the Content-Type
header: e.g.

Content-Type: text/plain; charset=iso-8859-15

corresponds to

    :setlocal fileencoding=iso-8859-15

or to

    :e ++enc=iso-8859-15

If there is _no_ Content-Type header, then some "default" is assumed (maybe
your current locale or, in Vim, your current 'encoding'). Both programs must
of course use the same default value for it to work.

I don't know how Vim communicates with pico: a file? a pipe? the clipboard?
Depending on the method, either 'fileencoding' or 'encoding' might be
relevant.

HTH,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: vim pine problem

A.J.Mechelynck
In reply to this post by Jorge Almeida
Oops... Forgot to reset the subject.

----- Original Message -----
From: "Jorge Almeida" <[hidden email]>
To: <[hidden email]>
Sent: Friday, August 12, 2005 12:41 PM
Subject: **SPAM** vim pine problem


> This is probably not a vim problem, but I couldn't google my way around
> it...
> I'm using pine as MUA, with vim as alternate editor. While editing in
> vim, accented characters are displayed just fine, but after quitting vim
> the accented characters give way to gibberish in pine's editor.
> Example: ?? (in vim) --> áç (in pico)
> (hope this shows right...)
>
> Note that I can get accented characters in pico. I can also read
> received messages containing accented characters in pine. The problem
> concerns only messages composed in vim and then "imported" to pico.
>
> Any hint?
>
> --
> Jorge Almeida
>
>
> --
> Jorge Almeida

Looks like an encoding problem. Are the mail headers available in Vim? Check
that the 'fileencoding' agrees with the second part of the Content-Type
header: e.g.

Content-Type: text/plain; charset=iso-8859-15

corresponds to

    :setlocal fileencoding=iso-8859-15

or to

    :e ++enc=iso-8859-15

If there is _no_ Content-Type header, then some "default" is assumed (maybe
your current locale or, in Vim, your current 'encoding'). Both programs must
of course use the same default value for it to work.

I don't know how Vim communicates with pico: a file? a pipe? the clipboard?
Depending on the method, either 'fileencoding' or 'encoding' might be
relevant.

HTH,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: vim pine problem

Jorge Almeida
On Fri, 12 Aug 2005, Tony Mechelynck wrote:

>
> Looks like an encoding problem. Are the mail headers available in Vim? Check
No, in vim you only get to see the body of the message you're
composing. Of course, after returning to pine's editor you have access
to the full headers.
> that the 'fileencoding' agrees with the second part of the Content-Type
> header: e.g.
>
> Content-Type: text/plain; charset=iso-8859-15
>
> corresponds to
>
>   : setlocal fileencoding=iso-8859-15

: setlocal fileencoding=iso-8859-1 did it!

I only wish there were better documentation on all matters
encoding/locale/whatever related (i.e. documentation readable by non
C-programmers).

>
> or to
>
>   : e ++enc=iso-8859-15
>
> If there is _no_ Content-Type header, then some "default" is assumed (maybe
> your current locale or, in Vim, your current 'encoding'). Both programs must
> of course use the same default value for it to work.
>
> I don't know how Vim communicates with pico: a file? a pipe? the clipboard?
A pipe, I suppose, but don't really know. Pine has a million options,
but I couldn't find any concerning the alternative editor--- other than
the name of the editor, of course.
> Depending on the method, either 'fileencoding' or 'encoding' might be
> relevant.
>
> HTH,
It certainly did.
> Tony.
>
>
Thanks.

Jorge
Reply | Threaded
Open this post in threaded view
|

Re: Re: vim pine problem

Walter Cazzola
Hi,
I'm new in this list, but I'm using vim with pine too and maybe I can
help.

On Fri, 12 Aug 2005, Jorge Almeida wrote:

> On Fri, 12 Aug 2005, Tony Mechelynck wrote:

>>  that the 'fileencoding' agrees with the second part of the Content-Type
>>  header: e.g.
>>
>>  Content-Type: text/plain; charset=iso-8859-15
>>
>>  corresponds to
>>
>>    : setlocal fileencoding=iso-8859-15

> : setlocal fileencoding=iso-8859-1 did it!

> I only wish there were better documentation on all matters
> encoding/locale/whatever related (i.e. documentation readable by non
> C-programmers).

I'm italian and like Portuguese we have a lot of accents that I use
without problems. My settings are:

in vim:

    encoding=latin1
    fileencoding=

and in pine:

   character-set = ISO-8859-1

>>  I don't know how Vim communicates with pico: a file? a pipe? the
>>  clipboard?

> A pipe, I suppose, but don't really know. Pine has a million options,
> but I couldn't find any concerning the alternative editor--- other than
> the name of the editor, of course.

I think it uses a file, in fact, if you look at your ~/tmp directory you
find a file named pico.«a number» and the related .swp file.

I hope this help.
Walter

--
Walter Cazzola, PhD - Assistant Professor, DICo, University of Milano
E-mail [hidden email] Ph.: +39 010 353 6637  Fax: +39 010 353 6699
· · · --------------------------- · · · --------------------------- · · ·
                ... recursive: adjective, see recursive ...
· · · --------------------------- · · · --------------------------- · · ·
Reply | Threaded
Open this post in threaded view
|

Re: Re: vim pine problem

Jorge Almeida
On Fri, 12 Aug 2005, Walter Cazzola wrote:
> I'm italian and like Portuguese we have a lot of accents that I use
> without problems. My settings are:
>
> in vim:
>
>    encoding=latin1
>    fileencoding=
>
I don't have the encoding set! Still, vim works OK without it, except
when doing the import vim --> pico.
Anyway, things work now (see previous email).
> and in pine:
>
>  character-set = ISO-8859-1
This one was already set.

>
>> >   I don't know how Vim communicates with pico: a file? a pipe? the
>> >   clipboard?
>
>>  A pipe, I suppose, but don't really know. Pine has a million options,
>>  but I couldn't find any concerning the alternative editor--- other than
>>  the name of the editor, of course.
>
> I think it uses a file, in fact, if you look at your ~/tmp directory you
> find a file named pico.?a number? and the related .swp file.
>
Thanks.

Jorge
Reply | Threaded
Open this post in threaded view
|

Re: Re: vim pine problem

A.J.Mechelynck
----- Original Message -----
From: "Jorge Almeida" <[hidden email]>
To: "Walter Cazzola" <[hidden email]>
Cc: <[hidden email]>
Sent: Friday, August 12, 2005 2:41 PM
Subject: Re: [VIM] Re: vim pine problem


> On Fri, 12 Aug 2005, Walter Cazzola wrote:
>> I'm italian and like Portuguese we have a lot of accents that I use
>> without problems. My settings are:
>>
>> in vim:
>>
>>    encoding=latin1
>>    fileencoding=
>>
> I don't have the encoding set! Still, vim works OK without it, except
> when doing the import vim --> pico.
> Anyway, things work now (see previous email).
[...]

In Vim, the 'encoding' (a global option) is always set; if you don't set it
yourself, Vim picks it from your current locale at startup; and I believe
that if, on Unix, your locale is C, Vim will set 'encoding' to latin1 (aka
iso-8859-1); but from your previous email it looks like your locale is set
to UTF-8, which cause Latin-1 characters above 0x7F (for instance, accented
characters) to be represented by two bytes each in Vim memory. The
'fileencoding' option (buffer-local) defines how this particular file's data
is represented on disk: if it is empty, the value of 'encoding' is used;
otherwise the data is "converted" from one representation to another when
reading or writing. So either "set encoding=latin1 fileencoding= " or "set
fileencoding=latin1" (with any compatible 'encoding') will give 8-bit Latin1
data on the disc (and iso-8859-1 is another name for latin1; Vim understands
both).

Best regards,
Tony.