]> git.joonet.de Git - adminer.git/commitdiff
Decode Windows error message
authorJakub Vrana <jakub@vrana.cz>
Tue, 9 Aug 2011 09:51:18 +0000 (11:51 +0200)
committerJakub Vrana <jakub@vrana.cz>
Tue, 9 Aug 2011 09:51:18 +0000 (11:51 +0200)
adminer/drivers/mysql.inc.php

index 7c54656066522082f959b096eef68a88e629b5c8..9b5ca98200fb0380d548a9a2a275e0ad14a7d94d 100644 (file)
@@ -253,7 +253,11 @@ if (!defined("DRIVER")) {
                        $connection->query("SET sql_quote_show_create = 1");
                        return $connection;
                }
-               return $connection->error;
+               $return = $connection->error;
+               if (function_exists('iconv') && !is_utf8($return) && strlen($s = iconv("windows-1250", "utf-8", $return)) > strlen($return)) { // windows-1250 - most common Windows encoding
+                       $return = $s;
+               }
+               return $return;
        }
 
        /** Get cached list of databases