|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-03-30 09:27 UTC] gerald at copix dot org
[2007-04-03 19:01 UTC] tony2001@php.net
[2011-11-04 15:49 UTC] tomasz at trejderowski dot pl
[2016-03-08 01:50 UTC] sixd@php.net
-Package: PDO related
+Package: PDO OCI
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 21:00:02 2025 UTC |
Description: ------------ Hello, While configured in UTF8 mode (eg with the connection string allRequiredInfos;charset=UTF8), when we try to get a VARCHAR2 field limited to X chars, PDO is assuming accents (???...) are 2 letters length) and then generates a warning if our content is X chars length (with accents) and truncates the end of the field. Warning: PDOStatement::fetchAll() [scriptAdr/function.PDOStatement-fetchAll]: column 0 data was too large for buffer and was truncated to fit it in /scriptPath.class.php on line 73 We tryed to activate mbstring extension, to use func_overload=4 with no success (the database itself is in ISO-8859-1). If we try not to communicate with the database in UTF8, accents are just ignored (? becomes e, ...) even with correct session parameters. Reproduce code: --------------- Considering the table MYTABLE { MYFIELD VARCHAR2(2); } with one record : MyField -------- ?a $pdo = new PDO ('pdo_oci:dbname= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521)) ) (CONNECT_DATA = (SID = mysid) ) );charset=UTF8', 'myLogin', 'myPassword'); $stmt = $pdo->doQuery ('select MYFIELD from MYTABLE'); $stmt->fetchAll (); //warning Expected result: ---------------- (array[0]->MYFIELD === '?a') === true; Actual result: -------------- (array[0]->MYFIELD === '?') === true (array[0]->MYFIELD === '?a') === true