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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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
utf8is to be tested you should put it at the beginning of that setting.Probably you have
fileencodingsset tolatin1for example. This encoding is always valid (there is no single byte combination that could be rejected).If you don’t want to change
fileencodingsyou can reload the file with::e! ++enc=utf8