How do I see the current encoding of a file in Sublime Text?

EncodingSublimetext2

Encoding Problem Overview


How do I see the current encoding of a file in Sublime Text?

This seems like a pretty simple thing to do but searching has not yielded much. Any pointers would be appreciated!

Encoding Solutions


Solution 1 - Encoding

Since this thread is a popular result in google search, here is the way to do it for sublime text 3 build 3059+: in user preferences, add the line:

"show_encoding": true

Solution 2 - Encoding

Another option in case you don't wanna use a plugin:

Ctrl+` or

View -> Show Console

type on the console the following command:

view.encoding()

In case you want to something more intrusive, there's a option to create an shortcut that executes the following command:

sublime.message_dialog(view.encoding())

Solution 3 - Encoding

With the EncodingHelper plugin you can view the encoding of the file on the status bar. Also you can convert the encoding of the file and extended another functionalities.

Demo

Solution 4 - Encoding

For my part, and without any plug-in, simply saving the file either from the File menu or with keyboards shortcuts

CTRL + S (Windows, Linux) or CMD + S (Mac OS)

briefly displays the current encoding - between parentheses - in the status bar, at the bottom of the editor's window. This suggestion works in Sublime Text 2 and 3.

Note that the displayed encoding to the right in the status bar of Sublime Text 3, may display the wrong encoding of the file if you have attempted to save the file with an encoding that can't represent all the characters in your file. In this case you would have seen an informational dialog and Sublime telling you it's falling back to UTF-8. This may not be the case, so be careful.

Solution 5 - Encoding

ShowEncoding is another simple plugin that shows you the encoding in the status bar. That's all it does, to convert between encodings use the built-in "Save with Encoding" and "Reopen with Encoding" commands.

Solution 6 - Encoding

plugin ConverToUTF8 also has the functionality.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionarturompView Question on Stackoverflow
Solution 1 - Encodingo.dView Answer on Stackoverflow
Solution 2 - EncodingHugo CorráView Answer on Stackoverflow
Solution 3 - EncodingRodri_goreView Answer on Stackoverflow
Solution 4 - EncodingGregordyView Answer on Stackoverflow
Solution 5 - EncodingBogdan CalmacView Answer on Stackoverflow
Solution 6 - EncodingHonghe.WuView Answer on Stackoverflow