How do I get rid of the "Â" character that I'm getting in the output of my php code?


#1

I'm adding text to a very simple PHP site, and for some reason, it's adding an "Â" at the end of some words in the text. There does not seem to be a pattern as to when it adds it, but maybe you can see one that I'm not seeing, as although I know HTML, I am a novice at PHP.

Here is an excerpt of the coding:

<div>ABOUT OUR AMAZING VOLUNTEERS</div>
<br />
<div>It's only right to add here that*several traveled hundreds of miles to Volunteer.</div>
  <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Chuck Bramwell,*our Leader of California Triple Crown & Frank Neal the Stat*Man*for CTC</div>

And here is the results that you see on the web page in a browser:

ABOUT OUR AMAZING VOLUNTEERS

It's only right to add here that several traveled hundreds of miles to Volunteer.
Chuck Bramwell, our Leader of California Triple Crown & Frank Neal the Stat Man for CTC

Suggestions?

UPDATE: I just noticed that when I copied and pasted the code into this post, it added an "" in the same place where the "Â" was added in the output, even though, in the code, neither an "" or an "Â" appeared. So I went back to the code, and even though I didn't see an "*" or an "Â", I deleted that space and hit the spacebar to replace the space, saved it, refreshed the page and VOILA! The  is gone! Not sure what happened, but I'm glad it was an easy fix.


#2

It seems like you have a virus in your PC. Please scan your PC with a good antivirus software.


#3

Thanks for your suggestion, but I have a Mac, for which there have been no known viruses written. I think it was caused by copy and pasting the code from one program to another instead of typing it in manually.


#4

You can try adding following code in the <head> tag of your web page:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


#5

Thanks. I've already fixed it via the above method, but I'll keep that in mind for the future.

Here is what is currently in the <head> tag of that page:

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />


#6

This subject came up a few times over the last week or so, try following some of the links in this post.

http://www.sitepoint.com/forums/showthread.php?811662-Storing-and-retrieving-Persian-characters


#7

While strictly true, 'virus' is too narrow a definition. When people say "there have been no known viruses"... the caveat that you dont often get to read is "excluding worms, trojan horses, spyware, adware, or spam, because they arn't viruses". Inqtana-A (worm). RSPlug (trojan). Lamzev (trojan). iBotNet (trojan botnet). MacSweeper (adware/spyware). Pwn2Own (classed as a 'browser vulnerability', it broke Safari's security in less than 10 seconds...). All arnt 'viruses', but they can still infect macs.

Antivirus software exists on macs for a reason. Malicious code for macs has existed for years - the examples above come from 2005-2009 alone, and are by no means an exhaustive list. Do not assume you are immune.