4

I am trying to work with a utf-8 encoded xml file in vim 7.3 running on ubuntu. ASCII characters display normally but vim gives me gibberish instead of the unicode characters. After trying the following, I've reached the limits of my knowledge:

1) Checked that unicode was enabled by running set termencoding?. Output was termencoding=utf-8.
2) I installed the script from here (vim.org/scripts)
3) moved my ~/.vimrc file into ~/.vim
4) moved it back into ~
5) followed the instructions in the accepted answer to this question.

Is there some other variable I'm supposed to set? I know my system has the fonts I need.


Update:
Issue seems to be limited to html files for some reason.


Update:
Solved. What I thought was unicode was in fact foreign ANSI

9
  • 1
    Can tou see UTF-8 in your terminal? Test to e.g. cat a file with Unicode multibyte characters. Apr 5, 2012 at 14:52
  • Yes, but not the file I'm trying to work with. Time for a little more testing, thanks.
    – Yitzchak
    Apr 5, 2012 at 15:00
  • 1
    Try the command file on the file in question to see encoding information. Apr 5, 2012 at 15:03
  • 1
    You don't need any script. Did you create the *.html files with Vim or with another editor? Did you download them from an FTP server? Do you have set termencoding=utf-8 and set encoding=utf-8 in your vimrc?
    – romainl
    Apr 5, 2012 at 21:26
  • 1
    What exactly is the "gibberish"? To me it sounds like the file you're working with contains Unicode characters that are not supported by the font that your terminal is using. But in that case the characters are shown as squares with their Unicode value inside.
    – richq
    Jul 21, 2012 at 14:54

0

Browse other questions tagged .