grejon04 Posted November 10, 2007 Share Posted November 10, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/76798-solved-char-set-encoding/ Share on other sites More sharing options...
Rhysyngsun Posted November 11, 2007 Share Posted November 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/76798-solved-char-set-encoding/#findComment-388929 Share on other sites More sharing options...
grejon04 Posted November 11, 2007 Author Share Posted November 11, 2007 But it does have to do with MySQL...doesn't that Latin1 char set have anything to do with it? The set won't be converted just because I specify a different encoding in an HTML header. Quote Link to comment https://forums.phpfreaks.com/topic/76798-solved-char-set-encoding/#findComment-389132 Share on other sites More sharing options...
Rhysyngsun Posted November 11, 2007 Share Posted November 11, 2007 latin1 is mysql's default character encoding. latin1 is equivalent to ISO 8859-1. Which character set are you trying to convert to specifically? Quote Link to comment https://forums.phpfreaks.com/topic/76798-solved-char-set-encoding/#findComment-389254 Share on other sites More sharing options...
grejon04 Posted November 11, 2007 Author Share Posted November 11, 2007 Whichever one will let me get rid of the curly text (smart quotes). Quote Link to comment https://forums.phpfreaks.com/topic/76798-solved-char-set-encoding/#findComment-389342 Share on other sites More sharing options...
Rhysyngsun Posted November 11, 2007 Share Posted November 11, 2007 Try taking a look at Chris Schiflett'sb log post on this: http://shiflett.org/blog/2005/oct/convert-smart-quotes-with-php There's a lot of similar solutions out there, maybe this one will work better. Quote Link to comment https://forums.phpfreaks.com/topic/76798-solved-char-set-encoding/#findComment-389411 Share on other sites More sharing options...
grejon04 Posted November 12, 2007 Author Share Posted November 12, 2007 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). Quote Link to comment https://forums.phpfreaks.com/topic/76798-solved-char-set-encoding/#findComment-389499 Share on other sites More sharing options...
grejon04 Posted November 13, 2007 Author Share Posted November 13, 2007 Solved, see http://www.phpfreaks.com/forums/index.php/topic,167355.0.html Quote Link to comment https://forums.phpfreaks.com/topic/76798-solved-char-set-encoding/#findComment-390730 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.