Jump to content

Retrieve Trademark symbol from mysql database


mainstreetop

Recommended Posts

Not sure of this belongs in this php forum or in a mySql forum. 

 

I am trying to echo a field from a mySql database that contains a brand name with the 'registered' or 'trademark' symbol already stored.  I'm using htmlentities($BrandName).  The Registered symbols are displaying ok, but the Trademark symbol displays as a small, empty box.

 

First, am I using htmlentities() properly?  Second, does anyone know of why this would be happening?  Thank you.

Thank you for responding so quickly.  Unfortunatley, those parameters htmlentities($field, ENT_COMPAT, 'UTF-8'); would not display any brands that had any type of symbol.

 

I did use this when initially parsing the XML (via XMLREADER) into the db:

mysql_query("SET NAMES `utf8`");

 

So, I assume this addresses your second point?

 

However, I'm not sure where/how ti use your final suggestion:

use mysql_set_charset

 

Of course, I should probably pose this issue in a mySql forum.

 

Thanks for your help.

What charset is your database and table in?

 

What charset is your page in? (<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />)

 

I'm going to bet the answer to one of those is ISO-8859-1 or a variant.  It does not contain the TM symbol.

What charset is your database and table in?

CHARSET=latin1

 

What charset is your page in? (<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />)

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

 

I'm not terribly familiar with character sets but it looks like I'm incompatible here.  Any idea where to make change?

Latin 1 = ISO-8859-1.  Make your database and fields UTF-8. 

 

Its been a long time since I've had to convert charsets in the database, but it should be as simple as running a few queries.

Check out http://www.haidongji.com/2008/11/11/convert-character-set-to-utf8-in-mysql/.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.