Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

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.