[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 613
  • Last Modified:

Special characters not showing on page

Hi all,

I'm writting a database driven website but I'm having a problem with the display.

For some reason characters like: "% - £ $ " etc are being replaced on the page with question marks and other stuff.

Anyone have any idea on how to fix this?  Right now what I'm having to do is to insert £ instead of £ , which is really not practical.

Hope someone can help.

thx

st3vo
0
ST3VO
Asked:
ST3VO
  • 3
  • 2
2 Solutions
 
ChimerazaCommented:
yeah those are special characters... with printing $ you need to escape it by placing the \ before it (\$)

You can use the ASCII code for them:
http://www.w3schools.com/TAGS/ref_urlencode.asp

Can you paste an example of exactly what is giving you that error and I'll correct it for you.
0
 
ST3VOAuthor Commented:
When I insert some text into the database I get lots of black diamonds with a ? on it.
For example if I type "It's" on the database field I will get "it?s (where the ? is the black diamond with the ? in the middle.

This is display on the page that is read from the database but in the database I didn't type the ? and it's not there, it's just displayed that way on the php page when echoing the field content.

I want to be able the write whatever and for it to display properly. Don't want to have to use ascii codes.

Hope this helps


0
 
ST3VOAuthor Commented:
OK, I fixed it, never mind.

Just have to add this line before the query:

mysql_query("SET NAMES 'UTF8'");

0
 
ChimerazaCommented:
Glad you sorted it!
0
 
ST3VOAuthor Commented:
Thanks :o)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now