将文件编码设置为 UTF8,并在崇高文本3中使用 BOM

当我打开一个文件在崇高的文本3,在底部我有一个选项来设置字符编码如图所示。

setting encoding

有一个设置为 UTF-8的选项,在做了一些研究之后,这意味着 UTF-8没有 BOM,但是我想把它设置为 带 BOM 的 UTF-8,如下所示:

UTF-8 with BOM

我怎样才能做到这一点从内部 ST3?

210469 次浏览

I can't set "UTF-8 with BOM" in the corner button either, but I can change it from the menu bar.

"File"->"Save with encoding"->"UTF-8 with BOM"

Into Preferences > Settings - Users
File : Preferences.sublime-settings

Write this :

"show_encoding" : true,

It's explain on the release note date 17 December 2013. Build 3059. Official site Sublime Text 3

Into the Preferences > Setting - Default

You will have the next by default:

// Display file encoding in the status bar
"show_encoding": false

You could change it or like cdesmetz said set your user settings.

By default, Sublime Text set 'UTF8 without BOM', but that wasn't specified.

The only specicified things is 'UTF8 with BOM'.

Hope this help :)