php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41695 In PDO DB output incorrectly chatset encoding
Submitted: 2007-06-14 23:12 UTC Modified: 2007-06-25 18:48 UTC
From: waps at pisem dot net Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.2.3 OS: Win XP Pro SP2
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: waps at pisem dot net
New email:
PHP Version: OS:

 

 [2007-06-14 23:12 UTC] 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) {


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-25 18:48 UTC] tony2001@php.net
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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 09:01:29 2025 UTC