ID:               41736
 Updated by:       [EMAIL PROTECTED]
 Reported By:      www dot php dot net at landrovez dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         MSSQL related
 Operating System: Fedora Core 6, Kernel: 2.6.20
 PHP Version:      5.2.3
-Assigned To:      
+Assigned To:      fmk


Previous Comments:
------------------------------------------------------------------------

[2007-06-19 10:19:36] www dot php dot net at landrovez dot com

Description:
------------
I'm running FreeTDS version 0.64 ( latest + stable ) connecting to
mssql  2000 database.

At the FreeTDS config located at: /etc/freetds.conf I've specified 
tds version = 8.0 
client charset = UTF-8

at the related connection, so far so good. it works.

The problem starts printing the data from the database.

When the last char of the selected array that I get from the DB query
is a hebrew char it moves it to the next position in the array for some
reason.

It only happens when the last char is hebrew, if the last char is "."
for example it works just fine.

I think its something to do with UTF-8.



Reproduce code:
---------------
$mssql = mssql_connect("SQLSERVER", "root", "PASSWORD");
$mssql_db = mssql_select_db("devel_table", $mssql);

$download_id = "1";

$download_res = mssql_query("SELECT ID, Title, Description, URL FROM
tblDemo WHERE Download_ID = '$download_id'");

$download = mssql_fetch_array($download_res);

echo "<pre>"
  print_r($download[Title]);
echo "</pre>";

Expected result:
----------------
Array
(
    [0] => 1
    [ID] => 1

    [1] => THE BEST GAME IN THE WORLD
    [Title] => THE BEST GAME IN THE WORLD

    [2] => DOWNLOADS THIS GREAT GAME NOW
    [Description] => DOWNLOADS THIS GREAT GAME NOW

    [3] => http://sample.com/download.zip
    [URL] => http://sample.com/download.zip
)


Actual result:
--------------
Array
(
    [0] => 1
    [ID] => 1

    [1] => THE BEST GAME IN THE WORL
    [Title] => THE BEST GAME IN THE WORL

    [2] => DDOWNLOADS THIS GREAT GAME NO
    [Description] => DDOWNLOADS THIS GREAT GAME NO

    [3] => Whttp://sample.com/download.zip
    [URL] => Whttp://sample.com/download.zip
)

*** the title should have been at hebrew for this bug to happen, for
your continence the title and description are set to English just to
show the example. 

As you can see it took the LAST hebrew letter from the END of the vchar
and moved it to the NEXT one by the select order.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41736&edit=1

Reply via email to