Jump to content

[SOLVED] Apostrophes don't display correctly


jcbarr

Recommended Posts

I'm pulling data from a MySQL database that is formatted as text in the database but when I display it after calling from the query, apostrophes don't display correctly. They show up as a question mark enclosed in a diamond like shape. I believe the exclamation points do the same thing.

 

I tried changing the format of the text to utf8_bin from Latin, but it still shows up that way. Am I missing something easy here?

Here is the code that is being used to display it as well.

 

<?
if (isset($pid) && !isset($event)){
$sql="SELECT * FROM roleplays WHERE id='$pid'";
$a=mysql_query($sql, $link);
$b=mysql_fetch_array($a);
extract($b);
echo "<img src='../images/body/$user.jpg' align=right hspace=5 vspace=5>";
echo "<b><h2>$title</h2></b><P>";
echo nl2br($content);
echo "<P><center><a href='../promos.php'>Back To Promos</a></center>";
}
?>

From what I remember it isn't your code or the database settings...it's what you are using to view the output. Try using a defining different encodings.

 

example:

 

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

 

Here's a helpful tutorial:

 

http://www.w3.org/TR/REC-html40/charset.html

 

Hope that helps.

 

 

This was another instance of me being dumb. It was a simple copy and paste error. When you paste them in to the form they come out funky, but if you type them they are fine. I'm gonna mark this as solved, but if anyone does know why that would happen I would be interested.

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.