I have no problem with UTF-8 chars in vim while editing, but when I do set fileencoding=utf-8 and then save and reload the file, vim displays nonascii chars incorrectly.
Why is that happening, and how to fix this?
What is the value of your 'fileencodings' setting? This setting determines what encodings are tried by Vim to interpret the contents of a buffer that is being loaded. The first encoding that does not result in a conversion error is assumed to be the current file's encoding.
If utf8 is to be tested you should put it at the beginning of that setting.
Probably you have fileencodings set to latin1 for example. This encoding is always valid (there is no single byte combination that could be rejected).
If you don't want to change fileencodings you can reload the file with: :e! ++enc=utf8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With