How can chinese display normally in vim? -


i use securecrt ssh linux machine.

securecrt' appearance encoded utf-8 enter image description here

now want open text including chinese character.

when input:

cat text 

it can display enter image description here

but when open vim, displays incorrect. enter image description here

enter image description here

what should test can display correct in vim

it looks vim interpreting file latin1. try opening file explicitly utf-8 via

:edit ++enc=utf-8 text 

if works, check

:set fileencodings? 

because default values (ucs-bom,utf-8,default,latin1), utf-8 detection should work out of box.

if doesn't work, check

:set encoding? 

if not utf-8, change default in ~/.vimrc:

set encoding=utf-8 

restart vim, , try again.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -