]> git.mjollnir.org Git - moodle.git/commitdiff
Detect Oracle Database Encoding in order to set CFG->unicodedb properly
authorstronk7 <stronk7>
Fri, 22 Sep 2006 17:23:09 +0000 (17:23 +0000)
committerstronk7 <stronk7>
Fri, 22 Sep 2006 17:23:09 +0000 (17:23 +0000)
lib/setuplib.php

index 3d9834b8cdfe275eceaad26aafb4ee2bf6682391..4ac9ef33af9195618ece31ad0cdabb1170d79e22 100644 (file)
@@ -121,9 +121,18 @@ function setup_is_unicodedb() {
         /// MSSQL only runs under UTF8 + the proper ODBTP driver (both for Unix and Win32)
             $unicodedb = true;
             break;
+        case 'oci8po':
+        /// Get Oracle DB character set value
+            $rs = $db->Execute("SELECT parameter, value FROM nls_database_parameters where parameter = 'NLS_CHARACTERSET'");
+            if ($rs && $rs->RecordCount() > 0) {
+                $encoding = $rs->fields['value'];
+                if (strtoupper($encoding) == 'AL32UTF8') {
+                    $unicodedb = true;
+                }
+            }
+            break;
     }
     return $unicodedb;
 }
 
-
 ?>