Created
February 1, 2014 03:46
-
-
Save zenith6/8747664 to your computer and use it in GitHub Desktop.
EC-CUBEに対して、DB接続の文字エンコーディングをDSNで指定するパッチです。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: data/class/db/SC_DB_DBFactory.php | |
| =================================================================== | |
| --- data/class/db/SC_DB_DBFactory.php (リビジョン 23329) | |
| +++ data/class/db/SC_DB_DBFactory.php (作業コピー) | |
| @@ -70,7 +70,8 @@ | |
| 'protocol' => 'tcp', | |
| 'hostspec' => DB_SERVER, | |
| 'port' => DB_PORT, | |
| - 'database' => DB_NAME | |
| + 'database' => DB_NAME, | |
| + 'charset' => 'utf8', | |
| ); | |
| } else { | |
| return ''; | |
| Index: data/class/SC_Query.php | |
| =================================================================== | |
| --- data/class/SC_Query.php (リビジョン 23329) | |
| +++ data/class/SC_Query.php (作業コピー) | |
| @@ -57,7 +57,8 @@ | |
| 'protocol' => 'tcp', | |
| 'hostspec' => DB_SERVER, | |
| 'port' => DB_PORT, | |
| - 'database' => DB_NAME | |
| + 'database' => DB_NAME, | |
| + 'charset' => 'utf8', | |
| ); | |
| } | |
| @@ -79,7 +80,6 @@ | |
| $this->conn = MDB2::singleton($dsn, $options); | |
| } | |
| if (!PEAR::isError($this->conn)) { | |
| - $this->conn->setCharset('utf8'); | |
| $this->conn->setFetchMode(MDB2_FETCHMODE_ASSOC); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment