Page 1 of 1

£ sign from database echoing as £

Posted: Wed Jan 16, 2008 7:46 am
by impulse()
The database field type is text but any GBP sign is echoing out as '£'. Do you have any suggestions as to why?

Regards,

Re: £ sign from database echoing as £

Posted: Wed Jan 16, 2008 8:43 am
by aceconcepts
Try using £ in it's place.

Also make sure your meta content-type charset is correct.

Re: £ sign from database echoing as £

Posted: Wed Jan 16, 2008 8:44 am
by Kieran Huggins
You also might want to be using the Unicode (utf-8) charset - there are several ways to define this: a header(), a <meta> tag... I use both to be safe.

Re: £ sign from database echoing as £

Posted: Wed Jan 16, 2008 10:11 am
by impulse()
Aceconcepts - That worked fine, I used str_replace() to do the work but that seems like a dirty way of doing it.

Keiran - Does the following look good:

In

Code: Select all

 
header('Content-Type: text/html; charset=utf-8');
<META HTTP-EQUIV="name" CONTENT="UTF-8">
 

Re: £ sign from database echoing as £

Posted: Wed Jan 16, 2008 10:53 am
by Kieran Huggins
Not quite...

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Check out http://tlt.psu.edu/suggestions/internat ... clare.html for more (like the proper xhtml declaration, which remains poorly supported)