Bug #16244 Updated: nvarchar fields do not return properly with sybase_fetch_*()
| From: | franck at sopac dot org | Date: | Mon, 10 Jun 2002 08:26:54 +0000 |
| Subject: | Bug #16244 Updated: nvarchar fields do not return properly with sybase_fetch_*() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-9992@lists.php.net to get a copy of this message | ||
ID: 16244
Updated by: franck@sopac.org
Reported By: nick@loman.net
Status: Open
Bug Type: Sybase (dblib) related
Operating System: Redhat Linux 7.2
PHP Version: 4.1.2
New Comment:
In fact php make a mistake on the length of the text buffer vs the
number of characters.
In a unicode string there are 2 bytes per characters. PHP thinks that
the number is the number of characters...
For instance the SQL network dump show the record as:
00d1 0400 "A"00 "R"00
and php takes 0400 as the number of characters instead of the number of
bytes and then report:
"AR " instead of "AR"
It is to be expected that this bug is on all unicode types...
I use MS-SQL7.0 freetds0.53 snapshot the sybase-php code (not
sybase-ct) and on Mandrake 8.2.
Previous Comments:
------------------------------------------------------------------------
[2002-03-24 10:52:10] nick@loman.net
When accessing a Microsoft SQL Server 2000 database using the sybase
access libraries and FreeTDS 0.53 running in TDS 7.0 mode, fields of
type 'nvarchar' do not appear the same as they do in the database.
Usually there are trailing characters from previous rows which have
already been fetched, pointing to a null-terminator/string length
issue.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16244&edit=1