Jump to content

[SOLVED] Euro symbol and accented characters in MYSQL


fohanlon

Recommended Posts

Hi

 

Can anyone point out a solution to my problem

 

I have built a cms where a user can all in content. The content can contain euro symbols and accented and they get stored ok in a text field in the mysql table.

 

The table is set as utf-8-general-ci.  As i read that thsi was the best for storing all symbols.

 

 

Problem is when the select in done in a web page to view the content the characters are appearing as square boxes.  Is there comething like htmlspecialchars I should be running on the content to fix this output?

 

Many thanks,

 

Fergal.

 

 

 

I have actually had a similar problem before, and I solved it making my own escape phrases sorta like xhtml has   or "  I just made stuff like € or &passo; and then I did a replace on the output and altered all inputers to use this.

I have actually had a similar problem before, and I solved it making my own escape phrases sorta like xhtml has   or "  I just made stuff like € or &passo; and then I did a replace on the output and altered all inputers to use this.

 

Not a good idea. Everything will work as-is if everything is UTF-8.

 

Thanks effigy

 

How would this work in a mysql select statement?

 

Fergal.

 

http://www.phpfreaks.com/forums/index.php/topic,159313.msg694931.html#msg694931

Thanks Guys for all the comments.

 

Effigy I placed your after my connection to database and before my select sql statement and it worked.

 

mysql_query("SET CHARACTER SET utf8");

mysql_query("SET NAMES utf8");

 

Many thanks,

 

Fergal.

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.