Doc #68573 [Com]: No mention that fetch_fields()'s output depends on client charset

From: Date: Fri, 04 Sep 2015 15:16:32 +0000
Subject: Doc #68573 [Com]: No mention that fetch_fields()'s output depends on client charset
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12722@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68573&edit=1 ID: 68573 Comment by: sebastianzartner at gmail dot com Reported by: sebastianzartner at gmail dot com Summary: No mention that fetch_fields()'s output depends on client charset Status: Closed Type: Documentation Problem Package: MySQLi related PHP Version: 5.6.3 Assigned To: philip Block user comment: N Private report: N New Comment: Great! Thank you! Previous Comments: ------------------------------------------------------------------------ [2015-09-03 23:32:23] philip@php.net Automatic comment from SVN on behalf of philip Revision: http://svn.php.net/viewvc/?view=revision&revision=337742 Log: Fixed PHP Bug #68573 by expanding the examples to use multiple character sets, and mentioning what 'length' means. ------------------------------------------------------------------------ [2015-09-03 23:31:08] philip@php.net Thank you for the detailed bug report, it is much appreciated. A fix has been committed to SVN and it will show up online shortly. The example was expanded to include the 'length' and use two different character sets (latin1 and utf8), and also the length description was expanded to explain bytes vs characters using utf8 and latin1 as examples. Again, thank you for the bug report. ------------------------------------------------------------------------ [2014-12-09 09:21:17] sebastianzartner at gmail dot com Description: ------------ --- From manual page: http://www.php.net/mysqli-result.fetch-fields --- The return values for mysqli_result::fetch_fields are vaguely defined. There is no mention that 'length' and 'charsetnr' depend on the default client character set, which can be changed via mysqli::set_charset. This leads to great confusions[1] as people expect 'length' to reflect the length they set for the column. E.g. a column defined as varchar(10) will result in 'length' being 30 and 'charsetnr' being 33 if the client charset is set to 'utf8'. [1] http://stackoverflow.com/q/10430406/432681 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68573&edit=1

« previous php.doc.bugs (#12722) next »