logo       


CVS: phpwiki/lib/WikiDB/backend ADODB_mysql.php,1.14,1.15 PDO_mysql.php,1.1: msg#00044

Subject: CVS: phpwiki/lib/WikiDB/backend ADODB_mysql.php,1.14,1.15 PDO_mysql.php,1.1,1.2 PearDB_mysql.php,1.18,1.19
Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11755

Modified Files:
        ADODB_mysql.php PDO_mysql.php PearDB_mysql.php 
Log Message:
more mysql-4.1 quirks: add utf8 to the charset aliases table. (Bug #1180108)


Index: ADODB_mysql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/ADODB_mysql.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -2 -b -p -d -r1.14 -r1.15
--- ADODB_mysql.php     1 Apr 2005 14:32:44 -0000       1.14
+++ ADODB_mysql.php     10 Apr 2005 10:43:25 -0000      1.15
@@ -47,11 +47,11 @@ extends WikiDB_backend_ADODB
         if ($this->_serverinfo['version'] > 401.0) {
             global $charset;
+            $aliases = array('iso-8859-1' => 'latin1',
+                             'utf-8'      => 'utf8');
             //http://dev.mysql.com/doc/mysql/en/charset-connection.html
-            if (strtolower($charset) == 'iso-8859-1') {
-                // mysql needs different names and doesn't resolve aliases
-                mysql_query("SET NAMES 'latin1'");
-                //mysql_query("SET CHARACTER SET latin1");
+            if (isset($aliases[strtolower($charset)])) {
+                // mysql needs special unusual names and doesn't resolve 
aliases
+                mysql_query("SET NAMES '". $aliases[$charset] . "'");
             } else {
-                //SET NAMES 'latin1' or 'utf8'
                 mysql_query("SET NAMES '$charset'");
             }

Index: PDO_mysql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PDO_mysql.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -2 -b -p -d -r1.1 -r1.2
--- PDO_mysql.php       10 Feb 2005 19:01:24 -0000      1.1
+++ PDO_mysql.php       10 Apr 2005 10:43:25 -0000      1.2
@@ -46,8 +46,13 @@ extends WikiDB_backend_PDO
         if ($this->_serverinfo['version'] > 401.0) {
             global $charset;
+            $aliases = array('iso-8859-1' => 'latin1',
+                             'utf-8'      => 'utf8');
             //http://dev.mysql.com/doc/mysql/en/charset-connection.html
-            //SET NAMES 'latin1' or 'utf8'
-            $this->query("SET NAMES '$charset'");
-            //SET CHARACTER SET latin1 for the default database.
+            if (isset($aliases[strtolower($charset)])) {
+                // mysql needs special unusual names and doesn't resolve 
aliases
+                mysql_query("SET NAMES '". $aliases[$charset] . "'");
+            } else {
+                mysql_query("SET NAMES '$charset'");
+            }
         }
     }
@@ -130,4 +135,7 @@ extends WikiDB_backend_PDO
 
 // $Log$
+// Revision 1.2  2005/04/10 10:43:25  rurban
+// more mysql-4.1 quirks: add utf8 to the charset aliases table. (Bug #1180108)
+//
 // Revision 1.1  2005/02/10 19:01:24  rurban
 // add PDO support

Index: PearDB_mysql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PearDB_mysql.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -2 -b -p -d -r1.18 -r1.19
--- PearDB_mysql.php    1 Apr 2005 14:32:44 -0000       1.18
+++ PearDB_mysql.php    10 Apr 2005 10:43:25 -0000      1.19
@@ -27,9 +27,10 @@ extends WikiDB_backend_PearDB
             if ($this->_serverinfo['version'] > 401.0) {
                 global $charset;
+                $aliases = array('iso-8859-1' => 'latin1',
+                                 'utf-8'      => 'utf8');
                 //http://dev.mysql.com/doc/mysql/en/charset-connection.html
-                if (strtolower($charset) == 'iso-8859-1') {
-                    // mysql needs different names and doesn't resolve aliases
-                    mysql_query("SET NAMES 'latin1'");
-                    //mysql_query("SET CHARACTER SET latin1");
+                if (isset($aliases[strtolower($charset)])) {
+                    // mysql needs special unusual names and doesn't resolve 
aliases
+                    mysql_query("SET NAMES '". $aliases[$charset] . "'");
                 } else {
                     mysql_query("SET NAMES '$charset'");



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe