Jump to content

Recommended Posts

Hello; I know this problem is so irritating but its sadly become my problem too. I did do the required reading before I posted this, though...

 

It's the damn curly text. I tried the convert_smart_quotes function from the article, htmlentities (which actually solved the problem for the people who ran the site with the same code before).

 

So, since the problem was solved on another server, could the problem be with the server's default character encoding? (do they have this?)

Mac OSX server, MySQL database with tables of Latin1 encoding.

 

There is a generic header file that is used with every page,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-AU">
  <head>
    <link rel="stylesheet" type="text/css" href="css/new.css" media="screen" title="New CSS" />
    <link rel="stylesheet" type="text/css" href="css/new-printer.css" media="print" title="New Print CSS" />
<script src="includes/scripts.js" type="text/javascript"></script>

<title><?php echo  $title ?></title>

 

Notice there is no meta tag, specifying

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

as with the other fix. And I feel like this may have something to do with it, but don't want to add it if it isn't necessary.

 

I looked at the site with my Firefox browser and the view->character encoding-> was set to ISO 8859-1. But I don't know if that means the site is set to that or just my browser, I suspect.

 

Any help with this would be awesome. I know you all have heard this too many times.

 

j

Link to comment
https://forums.phpfreaks.com/topic/76798-solved-char-set-encoding/
Share on other sites

This isn't a MySQL issue, it's a general PHP issue. Basically, the character encoding is set in the header sent by the server. You could try adding the following at the beginning of your file:

 

header('Content-Type: text/html; charset=utf-8');

 

or whatever charset you need

 

You can also set this in the php.ini file for your entire server I believe

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.