I was editing some files with vim on a new Linux server and was getting frustrated that everytime I try to type in or paste in the British Sterling/British pound symbol of £ it is prefixed with a strange character of Â. I did not have this problem with the pervious server I was using, which is based on FreeBSD. And when I tried to delete that character it deletes the £ character as well.
After almost pulling my hair out, I just figured out that it is an issue with character encoding in Vim.
If you type:
Vim will tell you the current encoding being used. So I typed that in Vim on the old FreeBSD server and it showed:
And when I did the same on the new Linux server in Vim, it showed:
By default, apparently the install in Linux for Vim uses UTF-8 unicode. But I wanted encoding, which worked for me, so in my .vimrc
file I entered:
And voila- no more oddball Â character weirdness.