File Corruptions when using Vim on iMac

1

I'm experiencing some strange file corruptions when editing PHP files in VIM/iTerm.

This is not exclusive to these but the corruptions are slightly different in Nano. Same issues appear in the default terminal.

Same files open fine on other (but newer) iMacs in the office and my Ubuntu laptop.

I'm SSHing into an Ubuntu server when editing these files.

Anyway, for example if I open a file that has been populated with the text "You’re supposed to be working."

It appears on mine as "You?re supposed to be working."

If I attempt to replace the character, I get "?<80><9d>" instead.

Alex L

Posted 2013-01-28T13:32:50.193

Reputation: 113

What's the value of :set encoding? in Vim? Does it work when you set it to utf-8? – Ingo Karkat – 2013-01-28T13:46:17.607

Value is utf-8 :s

Now NetBeans has also stopped accepting these characters and prints this instead: donât – Alex L – 2013-01-28T14:04:09.187

Answers

0

At some point in your editing, one editor opened/saved these files with the wrong encoding. What you shall do now is:

  1. determine which encoding(s) those files are in (mix of Latin1 and utf-8, probably),

  2. define which encoding you want (utf-8, maybe),

  3. find the best method for converting those files to the encoding defined at step 2 (iconv, maybe or manual find/replace),

  4. apply that method.

romainl

Posted 2013-01-28T13:32:50.193

Reputation: 19 227