Justification of file encoding and encoding in vim or elsewhere

I do not understand why VIM is there encodingas well fileencoding.

As far as I know, the file is like an array of bytes. When we create a text file, we create an array of characters (or characters) and encode this character array encoded with X into an array of bytes and save the byte array to disk. When reading in a text editor, it decodes an X-encoded byte array to restore the original character array and displays each character with a graph in accordance with the font. Only one encoding is involved in this process .

In VIM, set utf-8 encoding and file encoding , which tells the VIM wiki about working with unicode ,

encodes a set , as vim should represent characters inside . UTF-8 is required for most versions of Unicode.

fileencoding sets the encoding for a specific file (locally for the buffer)

" As vim should represent characters inside " against the " coding for a particular file " ... rewrites Unicode vs UTF-8? If so, why should the user worry about the first?

Any clues?

+3
source share
2 answers

; ( C , char, , UTF-8, wchar ( ), Unicode). API ( ).

Vim, ( Amiga, ) , .

  • , .
  • , Vim 'fileencodings' .
  • , 'encoding'. utf-8 .
  • , 'termencoding'.

, , !

+5

, , vim - .

, :

X .

, vim . vim , , , . vim , , "". , , .

, :

vim . Shift-JIS, UTF-16 / - / UTF-8. , vim ( , ), , .

: encoding Unicode, , . Unicode , , , , .

+4

All Articles