Take the 2-minute tour ×

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


