Make WordPress Core


Ignore:
Timestamp:
02/02/2007 12:04:35 AM (20 years ago)
Author:
ryan
Message:

First cut at mysql utf-8 charset suport. Props to sehh, drupal, and textpattern. fixes #3517

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/wp-db.php

    r4832 r4860  
    3636        var $postmeta;
    3737
     38        var $charset;
     39        var $collate;
     40
    3841        /**
    3942         * Connects to the database server and selects a database
     
    4952        function __construct($dbuser, $dbpassword, $dbname, $dbhost) {
    5053                register_shutdown_function(array(&$this, "__destruct"));
     54
     55                if ( defined('DB_CHARSET') )
     56                        $this->charset = DB_CHARSET;
     57
     58                if ( defined('DB_COLLATE') )
     59                        $this->collate = DB_COLLATE;
    5160
    5261                $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
     
    6372");
    6473                }
     74
     75                if ( !empty($this->charset) && version_compare(mysql_get_server_info(), '4.1.0', '>=') )
     76                        $this->query("SET NAMES '$this->charset'");
    6577
    6678                $this->select($dbname);
Note: See TracChangeset for help on using the changeset viewer.