22

Adding set listchars=tab:▸\ ,trail:·,extends:#,nbsp:· line is causing "CONVERSION ERROR" while saving the vimrc file. I am using gvim 7.3 under Window 7.

I have added this character using ("▸") using ctrl-vu 25B8.

my vimrc file has also set encoding=utf-8

Is it possible to resolve this error.

Thanks

Vivek Kumar
  • 4,822
  • 8
  • 51
  • 85
  • Got the fix, I need to place a space character after ▸\ like ▸\ , http://stackoverflow.com/questions/3766204/vim-doesnt-support-unicode – Vivek Kumar Oct 10 '12 at 11:56
  • I had the same problem. @IngoKarat's answer solved it. I was trying to use `˒` as my tab char. It's a little more inconspicuous. :D – trusktr Mar 02 '14 at 05:34

3 Answers3

53

Try saving with :w ++enc=utf-8. Also, it's recommended to put scriptencoding utf-8 at the top of your .vimrc.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • 1
    saving file using w ++enc=utf-8 way resolve the error. But doing :so $MYVIMRC giving E474: Invalid argument: listchars=tab:¿\,trail:·,extends:#,nbsp:. – Vivek Kumar Oct 10 '12 at 11:46
  • 3
    @dearvivekkumar Don’t forget about the second advice with `scriptencoding`. I would also suggest to be sure there is `set encoding=utf-8` somewhere at the very top of the vimrc. – ZyX Oct 10 '12 at 14:16
  • Awesome! This answer was the solution. – trusktr Mar 02 '14 at 05:33
  • 1
    This solved my problem. I think it's because the unicode character appear near the end of a very large file that vim initially thinks the file's not in utf-8. – KenIchi Feb 08 '18 at 00:42
  • Unfortunately if `":echo has("multi_byte_encoding")` returns 0 then neither `set encoding=utf-8` nor `scriptencoding utf-8` can help you – rshdev Jan 22 '19 at 20:02
5

I solved this error (although not from listchars) by changing the buffer's encoding and then saving:

:set fileencoding=utf-8
:write
idbrii
  • 10,975
  • 5
  • 66
  • 107
0

Got the answer from the link below, As I need to put a single space after ▸\ charter Vim doesn't support unicode?

Community
  • 1
  • 1
Vivek Kumar
  • 4,822
  • 8
  • 51
  • 85