Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a project where we need to convert weird characters generated from all kinds of file formats into ASCII due to compatibility issues. Is it possible in Sublime Text 2 to convert the encoding of a document to ASCII? We can't convert it to ANSI because that includes more characters that are not supported.

share|improve this question
7-bit ASCII has no support for "weird characters". So you want to just remove them from the file? If so, open with any 8 bit encoding and search for regular expression [\x80-\xff], replacing it with nothing. – Daniel Beck Jan 16 '13 at 15:32
ANSI is the organization that made ASCII so your question makes no sense. – barlop Dec 7 '14 at 22:50

Sublime text 2 will allow you to save with a variety of encodings, but won't do so if you have characters that don't fit in the encoding you are saving to. I had a problem recently were I was getting encoding errors at various positions in Mako templates and since the characters were not displayable in sublime text I couldn't even see them to remove them. So I opened the file in the hex editor HxD changed the offset base to decimal and went straight to the positions specified in the errors and removed the offending characters; Problem solved.

Also it didn't help me in this case but you might find this useful. The link above includes source that if saved to Preferences > Browse Packages > User will add absolute position of the cursor to the status line at the bottom of the Sublime Text window, though this didn't help me since the offending characters weren't displayable.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.