SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    May 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Unknown character display

    Hi,
    This is very frustrating but I have a problem. When I submit a form, the browser displays a question mark instead of the character and this is making my text display look very ugly.

    Please is there anything I can do to fix this problem. The problem can be found here: http://www.thascript.com/?lid=67

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Your database connection or database table or both are not set to use the UTF-8 encoding you're serving the page in. The character sets you're using to store the data and to display the data must match.

  3. #3
    SitePoint Member
    Join Date
    May 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Am so lost. Am a newbie so can you explain in plain english what I need to do to get rid of all that mess? Thanks

  4. #4
    John 8:24 JREAM's Avatar
    Join Date
    Sep 2007
    Location
    Florida
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey I had this a lot as well,

    in your html document it should have this meta tag to fix it (between the <head> here </head> tags)
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

  5. #5
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JREAM View Post
    Hey I had this a lot as well,

    in your html document it should have this meta tag to fix it (between the <head> here </head> tags)
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    He already has that meta tag, but the content in his database is not encoded as UTF-8. It looks like ISO-8859-1 but there are still a few odd characters when viewed as that encoding as well.

  6. #6
    SitePoint Wizard spence_noodle's Avatar
    Join Date
    Jan 2004
    Location
    uk, Leeds (area)
    Posts
    1,264
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    He needs to tell mysql query which text encoding he will be using and to do this just place this before any insert and update:

    Code MySQL:
    // Set Names to utf8
    mysql_query("SET NAMES 'utf8'");

    Where 'utf8' is, this can be changed to whatever you want, e.g. 'ISO-8859-1'.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •