Jump to content

Problems with '£'


otuatail

Recommended Posts

Hi. I have a web page that allows a comment field where any charecter can be entered including  '  "  and £.

 

I enter this into a database 

`Comment` varchar(32) NOT NULL DEFAULT '',

 

When this is displayed sometimes the pound symbol is displayed as a black demimonde with a question mark. It has a ascii value of 0.

 

How can I fix this? I enter it into the database as

Comment = str_replace ( "£", "£", $Comment ) ;

 

This doesn't fix it. It works fine when i enter it into the DB as \' and \".

 

TIA

 

Desmond.

 

Link to comment
Share on other sites

Make sure your table, your database connection, your scripts, and your web pages are all using UTF-8. At least one of them is not.

 

And don't do the str_replace() thing. Leave it as the £ character and fix the underlying problem of the character not being stored correctly.

Link to comment
Share on other sites

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.