From d51d0136661c484d551d94e83bdea8637a55e94c Mon Sep 17 00:00:00 2001
From: John Reese <jreese@leetcode.net>
Date: Fri, 30 Jan 2009 10:11:33 -0500
Subject: [PATCH] Fix #10056: Send the UTF8 command to MySQL databases during the installation/upgrade process.

---
 admin/install.php |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/admin/install.php b/admin/install.php
index 292d1c1..5bf409a 100644
--- a/admin/install.php
+++ b/admin/install.php
@@ -693,6 +693,13 @@ if( 3 == $t_install_state ) {
 			echo '<tr><td bgcolor="#ffffff" col_span="2"> Database Creation Suppressed, SQL Queries follow <pre>';
 		}
 
+		# Make sure we do the upgrades using UTF-8 if needed
+		if ( $f_db_type === 'mysql' || $f_db_type === 'mysqli' ) {
+			if( strtolower( lang_get( 'charset' ) ) === 'utf-8' ) {
+				$g_db->execute( 'SET NAMES UTF8' );
+			}
+		}
+
 		if( $f_db_type == 'db2' ) {
 			$result = &$g_db->execute( 'set schema ' . $f_db_schema );
 			if( $result === false ) {
-- 
1.6.1.2

