Member Offer
  1. 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)?

Discussion in 'Website Design Forum:' started by wwl777, Jan 5, 2011.

  1. wwl777

    wwl777 Junior Member

    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?
  2. Sunburn

    Sunburn Active Member

    This will be related to your character encoding...

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

    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  3. wwl777

    wwl777 Junior Member

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

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

    Harry Senior Member

    What editor?
  5. wwl777

    wwl777 Junior Member

    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]
  6. Sunburn

    Sunburn Active Member

    Is the data being pulled from a database?
  7. Harry

    Harry Senior Member

    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).
  8. wwl777

    wwl777 Junior Member

    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.
  9. wwl777

    wwl777 Junior Member

    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']);

  10. Sunburn

    Sunburn Active Member

    ah ! beat me too it.... just typing up checking the db charset and collation.

    Glad you fixed it.

Share This Page