Hi,
I would like to know how can I set vi to show and work with ASCII extended characters without problem.
Thanks!
Hi,
I would like to know how can I set vi to show and work with ASCII extended characters without problem.
Thanks!
Once the the characters are "extended" it's not ASCII any more.
However: Just use vim. ":help unicode" for more details.
Vim (which is what vi
resolves to on most systems) readily supports extended character sets. You might need to tell Vim which encoding to use, though.
This is controlled by two options:
:set encoding
:set fileencoding
If you have loaded a file that displays incorrectly, you may use :set encoding=<new encoding>
to force the appropriate encoding. This changes the interpretation of the characters on the fly. If you want to save the file in another encoding preserving the current interpretation of characters, use set fileencoding=<new encoding>
to let Vim save the file in that encoding.
I recommend that you set utf-8
as the default encoding in your .vimrc
.
I would suggest you to try the following:
set the terminal to utf-8 (how to do that depends on your terminal; in PuTTY it's in the Window/Translation menu)
set your locale to utf-8 (how to do that depends on your OS; on my Debian box it's set LC_ALL=en_GB.UTF-8
for the current session and sudo dpkg-reconfigure locales
for permanent system-wide changes) -- you can check your current locale with locale
.
That's how it works for me (using VIM 7.1.314 and no .vimrc
).