CoolComputing Logo
Coupons/Deals  ·  New Promo Codes/Coupons  · February 25, 2018

Fix Black Diamond with Question Mark in HTML After Switching Servers

Posted on Thursday, November 4, 2010 @ 04:12:28 PM CDT by David Yee [] [read 7050 times]

 
Tips: Linux/Unix world
Recently I switched the web hosting service provider, and noticed these odd black diamond shaped characters with a question mark in the middle on my web pages. Characters such as the double quote and the copyright symbol are all being replaced by this foul black diamond character with the ? in the center. Doing some research, it seems that happens because you have a character set, or charset, that does not match between the database, web server, and PHP.

I use Apache, MySQL, and PHP. Looking at the httpd.conf I noticed:

AddDefaultCharset UTF-8

In PHP.ini I see:

default_charset = "iso-8859-1"

and in my MySQL tables I see "DEFAULT CHARSET=latin1" when I do a "Show Create Table my_table_name".

Not wanting to convert my MySQL data to UTF-8, I edited the line in httpd.conf that showed "AddDefaultCharset UTF-8" to:

AddDefaultCharset On

I also edited the header file for my PHP web pages to show:

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

Voila- no more weird black diamond character with the question mark inside.



Please rate this article or post a brief review of Fix Black Diamond with Question Mark in HTML After Switching Servers or comment on benchmark/performance, features, availability, price or anything else regarding Fix Black Diamond with Question Mark in HTML After Switching Servers. Thanks!

Fix Black Diamond With Question Mark In HTML After Switching Servers Rating: 1.3/5 (7 votes cast)

Your Name:
I have read and agreed to the Review Posting Agreement.
Review Title:
Comment/Review: