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 have this character appearing in places in some files I have: Â (if you can't see it or it looks like a question mark it's the Acirc character (capital A with a circumflex over it))

I simply want to grep replace this char with a space, however when I do this:

grep --color -ri  myproject.php

Putty gets very confused, as does grep.

As I understand it there's probably a way to use an escaped hex code with grep.. does anyone know how?

EDIT: The character is showing up on my web page as a weird <?>. The http headers for the page specify utf-8 as does the meta character set and I still see the strange character. In putty it appears as a space (putty also set to utf-8.) When I copy from vim and paste into grep it simply doesn't find it.

Cheers, John

share|improve this question

migrated from Mar 10 '11 at 9:37

This question came from our site for system and network administrators.

In the end I ended up just removing them manually. Oh well :/ – John Hunt Mar 9 '11 at 23:55

What you're seeing is the first character of a UTF-8 sequence reinterpreted as another character set. The character isn't actually there per se, the tool you're seeing it in is just confused as to which character set it should be using; tell it to use UTF-8 instead.

share|improve this answer

You need to enable UTF-8 in PuTTY. Do this by going to the "Translation" configuration item in putty configuration settings. Change the dropdown entitled: Received data assumed to be in which character set.

share|improve this answer
This made the character appear as a space, but google chrome is still displaying it as a <?> diamond character and I still can't grep it. – John Hunt Mar 9 '11 at 22:03
This is because Google Chrome can't transcode or display your character. Usually it is because the font does not support your character. – Mircea Vutcovici Mar 9 '11 at 22:22

You must log in to answer this question.

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