From: toyomoyo Date: Wed, 5 Jul 2006 01:55:29 +0000 (+0000) Subject: merged fix for a problem where globallang is not respected in user table X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8ab2baa8f3ef0b007f63106e922767c424997a1a;p=moodle.git merged fix for a problem where globallang is not respected in user table --- diff --git a/lib/db/migrate2utf8.php b/lib/db/migrate2utf8.php index 19a8e5e5c9..8e32183660 100755 --- a/lib/db/migrate2utf8.php +++ b/lib/db/migrate2utf8.php @@ -3,7 +3,7 @@ function migrate2utf8_user($fields, $crash, $debug, $maxrecords) { - global $CFG, $db, $processedrecords; + global $CFG, $db, $processedrecords, $globallang; // convert all columns to blobs foreach ($fields as $field) { @@ -74,7 +74,11 @@ function migrate2utf8_user($fields, $crash, $debug, $maxrecords) { update_record('config',$migrationconfig); // this is the only encoding we need for this table - $fromenc = get_original_encoding('','',$record->lang); + if ($globallang) { + $fromenc = $globallang; + } else { + $fromenc = get_original_encoding('','',$record->lang); + } if (($fromenc != 'utf-8') && ($fromenc != 'UTF-8')) { foreach ($fields as $field) {