Sublime Text: How to automatically open with specific encoding for some file extensions?

Viewed 2698

Is there any way to force sublime (ST3) to open/reopen some kind of file with specific encoding? My problem is: I don't want ST3 to show content for specific file extension (i.e. .log, .dump, and my any other custom files). The current solution is to set the encoding manually to Hexadecimal through the view.set_encoding() method. The other solution was proposed on this discussion. But it seems only set the encoding after the file was opened. Is there any way to automatically open, or reopen those files with Hexadecimal encoding?

NOTE: I've set the default_encoding to UTF-8 and fallback to Hexadecimal. Since ST3 detect the content of my custom files as UTF-8, the content was then shown. I just want ST3 to show Hexadecimal view for some kind of custom files, and have to manually change the encoding to show/modify the content.

Really appreciate for any help,

1 Answers
Related