How to: Remove those nasty question marks with a diamond symbols that appears in your website

Problem: Help! I’ve pasted some text from Microsoft Word and saved it to my SQL database! Now whenever I print my text there’s a bunch of diamonds with a question mark symbols appearing!

Solution: You are trying to display characters that are outside your page’s character set, you have to tell your browser that you need to display characters from the iso-8859-1 set so it will know how to render them correctly.

Simply put the following inside your website’s <head></head>

<META http-equiv="Content-type" content="text/html; charset=iso-8859-1">

and in PHP(or any other similar language), simply put this at the top of your page(for other languages, look for an identical function):

<? header("Content-type: text/html; charset=iso-8859-1"); ?>

and voila! Your characters should now be displayed correctly.

120x20 thumb black How to: Remove those nasty question marks with a diamond symbols that appears in your website

Some links that you might find useful [External]:

Related posts:

  1. Super Tip: Pass Arguments in your Python Bindings using Lambda Functions
  2. How to: Fix OCUpload/One-Click Upload clicking bug in IE7 & IE8 (jquery)

Still can't see what you're looking for?



One Response to “”

  1. Thanks for that tip, I pasted the PHP line int the header of my Wordpress blog theme, and the question marks are gone, they’ve been there for months, thanks again.

  2. Tim on January 26th, 2010 at 2:40 AM

Leave a Reply

Anti-Spam Protection by WP-SpamFree