#41695 [Opn->Bgs]: In PDO DB output incorrectly chatset encoding
| From: | tony2001@php.net | Date: | Mon, 25 Jun 2007 18:48:49 +0000 |
| Subject: | #41695 [Opn->Bgs]: In PDO DB output incorrectly chatset encoding | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114202@lists.php.net to get a copy of this message | ||
ID: 41695
Updated by: tony2001@php.net
Reported By: waps at pisem dot net
-Status: Open
+Status: Bogus
Bug Type: PDO related
Operating System: Win XP Pro SP2
PHP Version: 5.2.3
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2007-06-14 23:12:23] waps at pisem dot net
Description:
------------
In PDO DB output incorrectly chatset encoding.
My Language Russian, encoding Windows-1251. I select result, and view
incorrectly result (bad charset).
Reproduce code:
---------------
Please insert to file /Db/Adapter/Pdo/Abstract.php on line ~124 next
code:
// set the PDO connection to perform case-folding on array keys, or
not
$this->_connection->setAttribute(PDO::ATTR_CASE, $this->_caseFolding);
// always use exceptions.
$this->_connection->setAttribute(PDO::ATTR_ERRMODE,
PDO::ERRMODE_EXCEPTION);
// set character encoding (this code added)
$this->query('SET CHARACTER SET cp1251');
$this->query('SET NAMES cp1251');
} catch (PDOException $e) {
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41695&edit=1