#43832 [Opn->Asn]: mysqi_get_charset() doesn't expose charset comment

From: Date: Sun, 13 Jan 2008 21:12:23 +0000
Subject: #43832 [Opn->Asn]: mysqi_get_charset() doesn't expose charset comment
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121253@lists.php.net to get a copy of this message
ID: 43832 Updated by: hholzgra@php.net Reported By: hartmut@php.net -Status: Open +Status: Assigned Bug Type: MySQLi related Operating System: linux PHP Version: 5.3CVS-2008-01-13 (CVS) -Assigned To: +Assigned To: andrey Previous Comments: ------------------------------------------------------------------------ [2008-01-13 21:11:37] hartmut@php.net Description: ------------ The mysql C API exposes a charset comment field (see http://dev.mysql.com/doc/refman/5.1/en/mysql-get-character-set-info.html) which exposes extra information on the character set. The information is the same as in the "Description" result column returned by "SHOW CHARSET;" IMHO the charset comment should be part of the mysqli_get_charset() result. Adding this to "classic" ext/mysqli is easy but getting this into mysqlnd seems to be more tricky Reproduce code: --------------- <?php $db = mysqli_init(); $db->real_connect("localhost", "root", "", "test"); var_dump($db->get_charset()); ?> Expected result: ---------------- object(stdClass)#2 (8) { ["charset"]=> string(6) "latin1" ["collation"]=> string(17) "latin1_swedish_ci" ["dir"]=> string(0) "" ["min_length"]=> int(1) ["max_length"]=> int(1) ["number"]=> int(8) ["state"]=> int(801) ["comment"]=> string(20) "cp1252 West European" } Actual result: -------------- object(stdClass)#2 (8) { ["charset"]=> string(6) "latin1" ["collation"]=> string(17) "latin1_swedish_ci" ["dir"]=> string(0) "" ["min_length"]=> int(1) ["max_length"]=> int(1) ["number"]=> int(8) ["state"]=> int(801) } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43832&edit=1

« previous php.bugs (#121253) next »