Convert all latin charsets.
authorJan Schneider <jan@horde.org>
Thu, 11 Nov 2010 14:19:01 +0000 (15:19 +0100)
committerJan Schneider <jan@horde.org>
Thu, 11 Nov 2010 14:19:01 +0000 (15:19 +0100)
framework/Db/lib/Horde/Db/Adapter/Mysql/Schema.php

index 0b18c31..005ce34 100644 (file)
@@ -159,10 +159,7 @@ class Horde_Db_Adapter_Mysql_Schema extends Horde_Db_Adapter_Base_Schema
      */
     public function _mysqlCharsetName($charset)
     {
-        $charset = strtolower(preg_replace('/[^a-zA-Z0-9]/', '', $charset));
-        if ($charset == 'iso88591') {
-            $charset = 'latin1';
-        }
+        $charset = strtolower(preg_replace(array('/[^a-zA-Z0-9]/', '/iso8859(\d)/'), array('', 'latin$1'), $charset));
         $validCharsets = $this->selectValues('SHOW CHARACTER SET');
         if (!in_array($charset, $validCharsets)) {
             throw new Horde_Db_Exception($charset . ' is not supported by MySQL');