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
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.
-
Thanks! turns out the conversion happened because I had some Greek words in there.– ToothrotJul 5, 2016 at 21:20
-