From 787692dfe70e77b7c9a93f3e6cae155ea8b3c879 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 8 Jul 2007 00:00:30 +0000 Subject: [PATCH] r1568: We now properly tell MySQL to use utf8 and we send a content-type header along with it, though it's an option in config.php so that people who don't use utf8 MySQL don't have problems --- docs/changes.txt | 1 + includes/config.php.new | 8 ++++++++ includes/init.php | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 53dfc93..fcb430e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -6,6 +6,7 @@ - Fixed: A "call to undefined function A()" would be thrown under some occasions when viewing a bug - Change: Email templates are now found in the locale/ directory so they can be translated (bug://report/81) - Fixed: Column headers were not translated for multiple languages (bug://report/79) +- Fixed: Multibyte language emails are now sent out correctly (bug://report/82) 1.2.0 Release Candidate 1 =============================== diff --git a/includes/config.php.new b/includes/config.php.new index 3ddbfcc..944ff40 100644 --- a/includes/config.php.new +++ b/includes/config.php.new @@ -47,6 +47,14 @@ $password = ''; // use to store information in. You or your host will have to make it. $database = 'bugdb'; +// ################################################################### +// ///////////////////////// UTF8 +// Set this to FALSE if you do not want to use UTF8 as your encoding +// It is recommended that you use UTF8, however. Do NOT set this to +// true if your database is not UTF8 (all new installations 1.2 and +// later do use UTF8) +$utf8 = true; + // ################################################################### // ///////////////////////// MYSQL PCONNECT // ------------------------------------------------------------------- diff --git a/includes/init.php b/includes/init.php index cd3f39d..503b7fc 100755 --- a/includes/init.php +++ b/includes/init.php @@ -47,6 +47,10 @@ $bugsys->setDebug($debug); define('ISSO_DB_LAYER', 'db_mysql'); $bugsys->load('db_mysql', 'db', true); $db->connect($servername, $username, $password, $database, $usepconnect); +if ($utf8) +{ + $db->query("SET NAMES utf8"); +} $bugsys->load('functions', 'funct', true); $bugsys->load('xml', 'xml', true); @@ -76,6 +80,10 @@ header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); +if ($utf8) +{ + header("Content-Type: text/html; charset=\"utf8\""); +} header("Pragma: no-cache"); // ################################################################### -- 2.43.5