Lamhot / php-google-map-api

Automatically exported from code.google.com/p/php-google-map-api
0 stars 0 forks source link

Unicode Problem #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.When get GeoCode cache, it doesn't support Unicode

I try to add a little patterm :

After :
/*****************************************************************/
        require_once('DB.php');
        $_db =& DB::connect($this->dsn);
        if (PEAR::isError($_db)) {
            die($_db->getMessage());
        }
/*****************************************************************/

Add this :
/*****************************************************************/
        $_db->query("set names 'utf8'");
        if (PEAR::isError($_res)) {
            die($_res->getMessage());
        }
/*****************************************************************/

before :
/*****************************************************************/
        $_res =& $_db->query("SELECT lon,lat FROM {$this->_db_cache_table} where address = ?", $address);
        if (PEAR::isError($_res)) {
            die($_res->getMessage());
        }
        if($_row = $_res->fetchRow()) {
            $_ret['lon'] = $_row[0];
            $_ret['lat'] = $_row[1];
        }
/*****************************************************************/

Original issue reported on code.google.com by JHL1...@gmail.com on 6 Sep 2010 at 9:53

GoogleCodeExporter commented 9 years ago

Original comment by b...@mycnl.com on 25 Sep 2011 at 3:28

GoogleCodeExporter commented 9 years ago
When this API was Using in Asia, when Address was Traditional 
Chinese、Simplified Chinese or Japanese,it will be  "?????????????" store in 
MySQL Tables.

Original comment by JHL1...@gmail.com on 25 Sep 2011 at 8:29