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.

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted

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

link|improve this answer
feedback

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.

link|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.stackoverflow.com/questions/6044/… – Chris Johnsen Apr 29 '10 at 1:13
feedback

Your Answer

 
or
required, but never shown

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