Created
January 21, 2015 04:24
-
-
Save PeteGoo/62190013610caec1e6d9 to your computer and use it in GitHub Desktop.
Sublime Text ASCII character display
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin, textwrap, unicodedata | |
# from http://stackoverflow.com/questions/22063366/show-info-about-current-character-in-status-bar-in-sublime-text-2 | |
class utfcodeCommand(sublime_plugin.EventListener): | |
def on_selection_modified(self, view): | |
# some test chars = $ € | |
sublime.status_message('Copying with pretty format') | |
selected = view.substr(view.sel()[0].a) | |
char = str(selected) | |
view.set_status('Charcode', "ASCII: " + str(ord(selected)) + " UTF: " + str(char.encode("unicode_escape"))[2:-1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment