Results 1 to 10 of 10

Thread: Space are displayed as question marks

  1. #1
    Join Date
    Apr 2006
    Location
    Amsterdam
    Posts
    352
    Thanks
    20
    Thanked 11 Times in 11 Posts

    Default Space are displayed as question marks

    Hello guys,

    I’ am not sure whether this is a PHP or MySQL problem. But I'm getting lots of question marks on one of my websites. All the text/content is stored in a MySQL 5 database.

    The plain text, as it is stored in de DB contains lots of spaces. Those space are being displayed as question marks. So either PHP or MySQL converts space to question marks.

    Here is an example of what I mean:

    http://dp4all.nl/?page=mydp&dp_action=view&id=388

    Really annoying. Has it got anything to do with the charset used my MySQL?

  2. #2
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Yes, when you use MySQL software like Query Analyser - what is displayed?
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  3. #3
    Join Date
    Apr 2006
    Location
    Amsterdam
    Posts
    352
    Thanks
    20
    Thanked 11 Times in 11 Posts

    Default

    Errr .. Query Analyser?
    Never heard of before ... url?

    I'm just using PHPmyAdmin, form what I can see in PHPmyAdmin is that
    charset "utf-8" is being used.

  4. #4
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Does PHPMyAdmin show the content of your tables fine?
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  5. #5
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    I have a feature on my text editor, BBEdit, called 'zap gremlins' which always clear these kind of things up. They normally result from copying and pasting from a non-ASCII source. I don't think the problem will be with the character sets between the database and the browser.

  6. #6
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Quote Originally Posted by nick View Post
    I have a feature on my text editor, BBEdit, called 'zap gremlins' which always clear these kind of things up. They normally result from copying and pasting from a non-ASCII source. I don't think the problem will be with the character sets between the database and the browser.
    Not entirely true, its when the encoding format does not match...

    However, in the case of database and website providing the data is fine in the actual database tables the problem is caused by the charset of the HTML document (as should defined in the head section) - generally UTF-8 is a decent character set to use as it covers all bases.

    Many web/software developers have no clue about data/text encoding and the character sets, I highly recommend developers look into it...

    http://annevankesteren.nl/2004/06/utf-8
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  7. #7
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    Quote Originally Posted by Warren Ashcroft View Post
    Not entirely true, its when the encoding format does not match...

    However, in the case of database and website providing the data is fine in the actual database tables the problem is caused by the charset of the HTML document (as should defined in the head section) - generally UTF-8 is a decent character set to use as it covers all bases.

    Many web/software developers have no clue about data/text encoding and the character sets, I highly recommend developers look into it...

    http://annevankesteren.nl/2004/06/utf-8
    Interesting read.

    I think my point was that often when I encounter these kind of problems, deleting non-ascii characters is a quick way round, because they are often just 'invisible' relic characters that have been left within the text. Doing this, and then specifying an encoding like utf-8 keeps everything good. If you do require the special characters in another encoding, you obviously wouldn't want to do this, and instead would need to make the browser aware of the charset required (and hope the user's system contains them). If you see what I mean hehe.

  8. #8
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Well if you use UTF-8 you can use the special characters from most character sets...

    UTF-8 is based on Unicode which is a brave ans sucesfull attempt to stop encoding issues because Unicode is a MASSIVE table of characters from all over the world.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  9. #9
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    Quote Originally Posted by Warren Ashcroft View Post
    Well if you use UTF-8 you can use the special characters from most character sets...

    UTF-8 is based on Unicode which is a brave ans sucesfull attempt to stop encoding issues because Unicode is a MASSIVE table of characters from all over the world.
    Agreed, but I did check the page, changing it to UTF-8 (I have a nifty live source code editor plugin for safari ) and the questionmarks still remain, in fact it shows up other problem characters that are fine in the current iso-8859-1 encoding.
    I should really mention that the original questionmarks I am seeing are seemingly good characters - just questionmark ones, which is slightly different to the questionmark like characters inserted (like the new ones I see when changing it to utf-8) when a character is missing from the charset (don't know if this is the same in windows, but on the mac you get a white questionmark in a black diamond). This therefore suggests to me that the problem has occured prior to the browser trying to render them.

    lol crikey, it's quite tough trying to describe what I mean, probably I'm not making any sense, but there is some sort of logic behind my ramblings.

  10. #10
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Well as I said, it could be a problem with the data in the database - if its wrong there then it aint going to come out right in the HTML
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. Pointing A Domain To Resold Space
    By MWF in forum General Technical Support
    Replies: 0
    Last Post: 30th August 2006, 08:50 AM
  2. The page cannot be displayed error
    By Spire in forum General Technical Support
    Replies: 10
    Last Post: 4th August 2006, 11:14 AM
  3. Legal Question
    By Wise Webs in forum Jokes and Stories
    Replies: 0
    Last Post: 13th January 2006, 12:47 PM
  4. Random Question
    By DavidJenkins in forum General Technical Support
    Replies: 3
    Last Post: 7th January 2006, 12:55 PM

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
  •