1

When I open my private spellfile en.utf-8.add, words containing unusual characters, such as pœësis, are rendered incorrectly; in this case, pÅësis. At the bottom of the screen it says [converted], and :set shows that the fileencoding is latin1. What is happening here and how can I have vim render such words correctly?

1 Answer 1

4

Try reopening the file and forcing it to load in "utf-8" mode. You can do this with

:e! ++enc=utf-8 %

From :help ++opt

                            *++opt* *[++opt]*
The [++opt] argument can be used to force the value of 'fileformat',
'fileencoding' or 'binary' to a value for one command, and to specify the
behavior for bad characters.  The form is: >
    ++{optname}
Or: >
    ++{optname}={value}

Where {optname} is one of:      *++ff* *++enc* *++bin* *++nobin* *++edit*
    ff     or  fileformat   overrides 'fileformat'
    enc    or  encoding     overrides 'fileencoding'
    bin    or  binary       sets 'binary'
    nobin  or  nobinary     resets 'binary'
    bad             specifies behavior for bad characters
    edit            for |:read| only: keep option values as if editing
                a file

I would also recommend adding

set encoding=utf8
set fenc=utf8

to your .vimrc if you have not already done so.

2
  • Thanks! turns out the conversion happened because I had some Greek words in there.
    – Toothrot
    Jul 5, 2016 at 21:20
  • @Toothrot Glad I could help!
    – DJMcMayhem
    Jul 5, 2016 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.