#24476 [NEW]: Character translation in mssql_query

From: Date: Thu, 03 Jul 2003 10:04:11 +0000
Subject: #24476 [NEW]: Character translation in mssql_query
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-43166@lists.php.net to get a copy of this message
From:             andrea dot balducci at antos dot it
Operating system: WINXP / WIN2000 SRV
PHP version:      5.0.0b1 (beta1)
PHP Bug Type:     MSSQL related
Bug description:  Character translation in mssql_query

Description:
------------
I'm trying to insert chars like ò à è é ì in a sql server 2K table.
Sometimes the chars are traslated in others.



Tryed with php 4.x and 5

Reproduce code:
---------------
Table Sample:
CREATE TABLE pippo (
	[a] [text] COLLATE Latin1_General_CI_AS NULL ,
	[b] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
)

Script sample:
<?php
    $conn = mssql_connect('localhost','sa','');
    if (!mssql_select_db('mydb', $conn))
    {
        mssql_close($conn);
        return 0;
    }
    mssql_query("INSERT INTO PIPPO (A,B) VALUES
('òàèéìù','òàèéìù')",
$conn);
    mssql_close($conn);
?>


Expected result:
----------------
Select * from pippo
  A      B
------- -------
òàèéìù	òàèéìù

Actual result:
--------------
Select * from pippo
  A      B
------- -------
=ÓÞÚý¨	=ÓÞÚý¨


Using Sql Profiler i've discovered that the query issued to sql server by
mssql_query has the characters already changed. So sql exec "INSERT INTO
PIPPO (A,B) VALUES ('=ÓÞÚý¨','=ÓÞÚý¨')"

-- 
Edit bug report at http://bugs.php.net/?id=24476&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=24476&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=24476&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24476&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24476&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24476&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24476&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24476&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24476&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24476&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24476&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24476&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24476&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24476&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24476&r=gnused



Thread (5 messages)

« previous php.bugs (#43166) next »