Website replacing characters with question marks (?)

  • Mars
  • Graduate
  • Graduate
  • User avatar
  • Posts: 160
  • Loc: Flordia

Post 3+ Months Ago

Hi, I have a website that stores user-submitted text and then places it on a page and I'm getting lots of question marks:

"For this year�s Company Visit, we will learn about..."

any idea how to fix this? Thanks.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

You could get the site to replace the symbles that dont work with there ascii value so &quot is a " etc there is a list here http://www.asciitable.com/ that may work.
  • Mars
  • Graduate
  • Graduate
  • User avatar
  • Posts: 160
  • Loc: Flordia

Post 3+ Months Ago

It's all done on the fly, so I'm kind of looking for a way to parse the extra characters, cause I need them to show. For instance if someone posts something in spanish it needs to show the accent marks. etc.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

What charset are you using? You should probably be using UTF8 based on your description of what you want.

Code: [ Select ]
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
  • Mars
  • Graduate
  • Graduate
  • User avatar
  • Posts: 160
  • Loc: Flordia

Post 3+ Months Ago

Yea, I am:

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

here's an example of what I'm talking about:

http://www.calendartweet.com/105
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

It appears it's something funky in the php code that renders the HTML for the page. Nearly impossible to say what though.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

Have you tried escaping the chars on your output var before throwing them into a page?

htmlspecialchars()
htmlentities()
  • Mars
  • Graduate
  • Graduate
  • User avatar
  • Posts: 160
  • Loc: Flordia

Post 3+ Months Ago

all I'm doing is grabbing it from the database and using nl2br() and replacing urls with links. When inserting all I do is strip_slashes()

I had the code on a wordpress installation and it was working fine, then we changed it to our own design (not really changing the backend code at all) and somehow foreign characters aren't showing up anymore. So my guess is that wordpress was doing something fancy to render the text right. Even though all the code to insert and retrieve the user-entered data was my own.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

I've hit the same thing with SugarCRM before. They have their own approach to encode/decode which they apply at the DB class level, so for the most part, you don't even know it occurs.

Try escaping the info before storing it or try encoding/decoding your results from the query. Maybe applied on one side or the other, it will help your issue.
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

That's odd because I am using MySQL to get dynamic pagers and all the character show up fine. But I use ISO-8859-1 can't see how that could make a difference, but...
  • Mars
  • Graduate
  • Graduate
  • User avatar
  • Posts: 160
  • Loc: Flordia

Post 3+ Months Ago

It's only with foreign languages. And certain symbols. The weird thing is that it was working when I had it running on top of wordpress. So I'm thinking that it's not something with the database, but in the front end that's causing this.

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 90 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.