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?
Asked
Active
Viewed 332 times
1
Toothrot
- 3,129
- 13
- 27
1 Answers
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.
DJMcMayhem
- 17,581
- 5
- 53
- 85
-
Thanks! turns out the conversion happened because I had some Greek words in there. – Toothrot Jul 05 '16 at 21:20
-
@Toothrot Glad I could help! – DJMcMayhem Jul 05 '16 at 21:29