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?

Link to comment
Share on other sites

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>";
}
?>

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.