Jump to content

[SOLVED] Char set encoding


grejon04

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

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.