Sublime Forum

Convert selection to ASCII?

#1

I use the TextMate command Converting / Stripping > Transliterate Word to ASCII (there’s a mouthful) quite often to strip out “smart” quotes, emdashes and the like. Or convert them to their ASCII equivalents, rather, so “ becomes ", etc.

Is this functionality by any chance built into ST2? (Nothing comes up in cmd-shift-P). Or anybody have a Python solution handy?

0 Likes

#2

The only encoding I know of is Ctrl+Shift+P: HTML: Encode Special Characters?

Shame, we need more really!

0 Likes

#3

I wrote a very rudimentary command for that. I mostly use it for cleaning up text that’s been pasted from Word.
https://github.com/funkjedi/SublimePackages/blob/master/User/normalize_unicode_punctuation.py

0 Likes

#4

[quote=“funkjedi”]I wrote a very rudimentary command for that. I mostly use it for cleaning up text that’s been pasted from Word.
https://github.com/funkjedi/SublimePackages/blob/master/User/normalize_unicode_punctuation.py[/quote]

Nice! Thanks, that works great.

0 Likes

#5

That Github link is dead, anybody have the plugin lying around that they can share?

0 Likes

#6

Is this what you’re looking for ?
github.com/funkjedi/SublimeText … tuation.py

0 Likes