You are not logged in.

#1 2008-05-02 01:09:11

sullivanva
Member
From: Herndon, VA USA
Registered: 2005-07-21
Posts: 126

vim and special characters

I'm using vim, and I get these special characters:

it didn<92>t

there was<85>it

I can manually delete the characters one by one, but I would rather search and replace.

I figure that <92> stands for '

not sure what <85> stands for


--HAPS

Offline

#2 2008-05-02 06:34:52

Burt
Member
Registered: 2008-03-30
Posts: 13

Re: vim and special characters

:%s/<92>/'/gc should work (% is for all the file, g is for global and the c will make him ask confirmation for every replacement to do).

Offline

#3 2008-05-02 18:13:31

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: vim and special characters

try ":help encoding-table".
Another possible culprit is your terminal emulator. Issue "cat /your/file" and see if the characters are displayed properly (but then again, it may be cat's fault, but I wouldn't expect that). Alternatively, try opening the file in gvim and see if the characters are displayed properly there. Make sure it uses a similar vimrc file!

Last edited by peets (2008-05-02 18:15:35)

Offline

#4 2008-05-03 00:50:03

sullivanva
Member
From: Herndon, VA USA
Registered: 2005-07-21
Posts: 126

Re: vim and special characters

Just to clarify, the <92> is a single character.  It probably has to do with the encoding.

In "it didn<92>t ", the <92> character gets replace with a '.

Thank you for the recommendation of using gvim, I was able to select and do a search and replace.


--HAPS

Offline

Board footer

Powered by FluxBB