]> git.mjollnir.org Git - moodle.git/commitdiff
fix for 5204
authortoyomoyo <toyomoyo>
Tue, 18 Apr 2006 09:05:07 +0000 (09:05 +0000)
committertoyomoyo <toyomoyo>
Tue, 18 Apr 2006 09:05:07 +0000 (09:05 +0000)
admin/utfdbmigrate.php

index 5434f002b45066278ad16a521e02d47e99c6bf06..d71b7addd0c8832fc0d8ce3854d0ead6bfc60ef1 100755 (executable)
@@ -686,11 +686,18 @@ function db_migrate2utf8(){   //Eloy: Perhaps some type of limit parameter here
     //remove the cache file!
     @unlink($CFG->dataroot.'/cache/languages');
 
+    // Regenerate some cached data
+    
+    if ($db->dbtype == 'mysql') {
+        $db->Execute("SET NAMES 'utf8'");
+    } else if ($db->dbtype == 'postgres7') {
+        $db->Execute("SET NAMES 'utf8'");
+    }
+    
+    rebuild_course_cache();
+
     //set the final flag
     migrate2utf8_set_config('unicodedb','true');    //this is the main flag for unicode db
-
-    // Regenerate some cached data
-    rebuild_course_cache();       
     
 }