Sublime Forum

CP 852 Support

#1

Hi,
my colleagues and I are very fond of Sublime Text 3. It would be great tool to work with. But we cannot use it, because of the non existent support for code page 852 in which we write all our production code. At this time, we cannot move to Windows 1250, yet.

Is there a possibility:

  1. You include CP852 in supported encodings and then we buy few licences
  2. You tell me if it is doable, would be nice if you actually point me in direction, and I would make this plugin, so we could use it for writing production code.

Any help would be appreciated.

0 Likes

#2

Ok, so this was a bit hasty. I figured it out with the help of another plugin, so I’ll post the solution here for anyone, who is interested in CP852 or…any other code page.

Install this plugin:
https://github.com/seanliang/ConvertToUTF8

For configuration, just follow the instruction from the creator.

If you want to add support for another encoding supported by Python(which is the only limiting factor), edit:
(user preferences file, see the official instructions for plugin configuration)
/user/ConvertToUTF8.sublime-settings

Here I added "Central European (CP852)", “CP852”] into the "encoding_list"

But you also want to force this conversion from menu. In this case, you want to edit:
/ConvertToUTF8/Main.sublime-menu
In my case, I ended up adding two lines of code to appropriate places:
{ “caption”: “Central European (CP852)”, “command”: “convert_to_utf8”, “args”: {“encoding”: “CP852”, “stamp”: “0” } },
and
{ “caption”: “Central European (CP852)”, “command”: “reload_with_encoding”, “args”: {“encoding”: “CP852”, “stamp”: “0” } },

However, I suspect this solution will stop working, when an update is performed. I think it will rewrite the Main.sublime-menu file. Maybe there is a better solution. But even after an update, this is not much of a problem as the plugin won’t stop working. You only won’t be able to find requisite commands under the File>Set file enc/Reload file enc until you set them up in the menu file.

0 Likes