Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
What's the value of :set encoding? in Vim? Does it work when you set it to utf-8? – Ingo Karkat Jan 28 '13 at 13:46
Value is utf-8 :s Now NetBeans has also stopped accepting these characters and prints this instead: donât – Alex L Jan 28 '13 at 14:04
up vote 0 down vote accepted

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .