• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Special characters not supported (html)?


wwl777

Junior Member
#1
I noticed that on one of my sites characters like é or » show up fine without using their html entity (é and »). On the other site it has no idea what they are and displays a question mark:

Why is this?
 

Sunburn

Active Member
#2
This will be related to your character encoding...

place this in the head of your document, should sort it out.

Code:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
 

wwl777

Junior Member
#3
I already thought it had something to do with the character encoding. I'm using html5 and had this in my <head>

Code:
<meta charset="utf-8">
I also tried your code, but it still displays as
 

wwl777

Junior Member
#5
My loyal helpers, sunburn and Harry :D
It displays fine in my editor (notepad++), but not on the locally hosted website (using xampp). [For example Dé on the one site is displayed as D� on the other]
 

Harry

Senior Member
#7
In Notepad++ I have this problem sometimes (usually when using content:""; in CSS). Head to Encoding --> UTF-8. See if that does anything (provided it's not DB content).
 

wwl777

Junior Member
#8
Yeah, it does pull the info/text out of a database. I've just put the site online and the problem remains.

The same database on another site shows the characters like it should.

@Harry, it was indeed set another encoding (ANSI). Setting and saving it into utf-8 didn't change anything though.
 

wwl777

Junior Member
#9
Good suggestion about that it is pulled from the database. Even if I encode my php page as utf-8, if it pulls stuff from the database it means those strings are written to the database in iso-8859-1 format. I changed my code to convert it to utf8::

$text= utf8_encode($row['text']);

Fixed!!