Add back the UTF8 database set names call, and switch all emails to use UTF8 encoding

This commit is contained in:
james 2010-06-09 15:14:41 +00:00
parent d5ed8a1fc4
commit 4799b4ffd8

View File

@ -100,6 +100,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 utf8 encodings
@mysql_query("SET NAMES utf8");
//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'");
@ -1050,6 +1053,11 @@ require_once("Rmail/RFC822.php");
//this sends out an all-ready-to-go email, it does no substitution or changes or database lookups or anything
function email_send_new($to,$from,$subject,$body,$bodyhtml="") {
$mail=new RMail();
$mail->setHeadCharset("UTF-8");
$mail->setTextCharset("UTF-8");
$mail->setHTMLCharset("UTF-8");
$mail->setFrom($from);
$mail->setSubject($subject);
$mail->setText($body);