zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.4k stars 1.16k forks source link

support BOM head on win , linux #3369

Open kasini3000 opened 2 days ago

kasini3000 commented 2 days ago

support BOM head on win , linux

Because both 'vi' and 'vim' under Linux supports bom headers.

Specifications

  1. Detect the three bytes in the file header.
  2. According to the encoding meaning of bytes, parse and open the text file.
  3. Save the text file according to the original encoding of the file and the BOM header.

Golang should have such a library.

Commit hash: OS: Terminal: