Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

When viewing a particular text file in vim or less on Linux or OS X, all the en dashes show up as highlighted "<97>" characters.

What control-sequence do I need to type in order to substitute the hyphens back? For example, the following doesn't work in vim:

% s/<97>/--/g 

Typing bracket nine seven bracket is not the same as typing the actual special character.

share|improve this question
up vote 2 down vote accepted

The correct fix is to take your file and run it through iconv to convert from CP1252 to UTF-8.

share|improve this answer

After some troubleshooting I seem to have figured it out. The control sequence is

ctrl-V X 9 7 

Substituting that for the <97> in the vim code above works.

share|improve this answer
    
Accept your answer? – marcusw Apr 29 '10 at 0:33
    
@marcusw: A question must be at least two days old before the OP can accept their own answer. meta.stackexchange.com/questions/6044/… – Chris Johnsen Apr 29 '10 at 1:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .