Sublime Forum

Setting a default encoding, is this possible?

#1

I have some files that use the old DOS codepage 437 line drawing characters to draw diagrams and boxes around comments. These characters exist in the font DejaVu Sans Mono. If i load my files into Sublime using the “Open with encoding” menu item, DOS CP 437 can be selected and my files look great using DejaVu Sans Mono. Is there a setting to make DOS CP 437 the default encoding for any file read into Sublime with the Open menu item?

TIA for all your help.

0 Likes

#2

There’s currently no way to set the default encoding, but you can make it easier to open files using a particular encoding, for example, if you save this:

<bindings>
	<binding key="ctrl+alt+o" command="openWithEncoding 'DOS (CP 437)'"/>
</bindings>

into Packages/User/Default.sublime-keymap, it’ll bind ctrl+alt+o open a file using CP 437.

I’ll put an item to the todo list to allow the fallback encoding to be changed from CP 1252.

0 Likes

#3

Wow, that was quick! Thank you for the work-around and the impending addition.

0 Likes