Friday, April 9, 2010

Re: Vim accented characters in text based console

On 10/04/10 01:48, Luis P. Mendes wrote:
> Hi,
>
> I use Vim everyday, I could say at every hour :-) in X graphical mode.
> $ vim --version
> VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Aug 24 2009 20:12:41)
> Included patches: 1-245
>
> I tried to use Vim with no X, in text base mode, but there was one
> problem with accented characters. I could not use them and the ones
> that where inserted before in graphical mode were like strange
> characters.
> Example:
> ã with X, is ~a in text mode
> the same with é --> 'e
>
> I checked LC_ALL and is defined to pt_PT in either situations.
> What should I correct to be able to use Vim in text mode in my
> Slackware 13 64 bits box?
>
>
> Luis
>

There seems to be something weird in the way your terminal represents
characters. What does bash answer to

echo -e '\0351'

? Mine replies with a reverse-video question mark because my terminal is
in UTF-8; if yours is in Latin1 the reply ought to be é, but if it is 'e
it shows that the terminal interprets é -> 'e after bash outputs it. (In
a UTF-8 terminal, to get é you need echo -e '\xC3\xA9' but then your
LC_CTYPE [or your LC_ALL, which overrides all other locale settings]
should be pt_PT.utf8 .)

To see all possible Portuguese locales, use

locale -a |grep ^pt

On my system, the answer is

pt_BR
pt_BR.utf8
pt_PT
pt_PT@euro
pt_PT.utf8

I'm not sure how to tweak the way your Linux terminal represents
characters above 0x7F.


Note that GNU bash's implementation of echo (as shown above) is not
POSIX-compliant. If you're using a different shell, either use bash as
an auxiliary shell, or find out if and how your implementation of echo
differs from mine.


Best regards,
Tony.
--
Malek's Law:
Any simple idea will be worded in the most complicated way.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe, reply using "remove me" as the subject.

No comments: