From f0dc0d938f54e2eae1a832d5b8b674d80f80c32b Mon Sep 17 00:00:00 2001 From: james Date: Tue, 9 Oct 2007 18:48:41 +0000 Subject: [PATCH] Character set stuff for MySQL 5.x --- common.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common.inc.php b/common.inc.php index 0f0bb83..f75bfcc 100644 --- a/common.inc.php +++ b/common.inc.php @@ -92,6 +92,9 @@ if(!mysql_select_db($DBNAME)) exit; } +//this will silently fail on mysql 4.x, but is needed on mysql5.x to ensure we're only using iso-8859-1 (/latin1) encodings +@mysql_query("SET NAMES latin1"); + //find out the fair year and any other 'year=0' configuration parameters (things that dont change as the years go on) $q=@mysql_query("SELECT * FROM config WHERE year='0'"); @@ -349,6 +352,7 @@ function send_header($title="") if($HEADER_SENT) return; else $HEADER_SENT=true; + header("Content-Type: text/html; charset=iso-8859-1"); echo "\n"; ?>