Connecting Tech Pros Worldwide Help | Site Map

Displaying Special characters(like®) From SQL in Internet Explorer

Newbie
 
Join Date: Aug 2007
Posts: 1
#1: Aug 30 '07
If i store the string which contains special characters(®) in MySQL database ,it stores
special characters as it is. But when i try to diplay that string using HTML & queries, it shows '?' character for ® in Firefox & shows some another character in Internet Explorer.
Please try to answer that!
mwasif's Avatar
Moderator
 
Join Date: Jul 2006
Location: Pakistan
Posts: 718
#2: Aug 30 '07

re: Displaying Special characters(like®) From SQL in Internet Explorer


Are you setting page character set to UTF-8? If not, use the following tag between <head> and </head? tags
Expand|Select|Wrap|Line Numbers
  1. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#3: Aug 30 '07

re: Displaying Special characters(like®) From SQL in Internet Explorer


Heya, Raju.

You also need to make sure that you are fetching the data as UTF-8. Try calling this when you connect to the database:
Expand|Select|Wrap|Line Numbers
  1. mysql_query("SET NAMES 'utf8'");
  2. mysql_query("SET CHARACTER SET 'utf8'");
  3.  
Reply