ID: 24476 Updated by: [EMAIL PROTECTED] Reported By: andrea dot balducci at antos dot it -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: WINXP / WIN2000 SRV PHP Version: 5.0.0b1 (beta1) New Comment:
I have tested the latest version of both php4 and php5 and I can't reproduce this problem. It sounds like you are using two different methods to access the database. When PHP is used with a web server the MSSQL extension will use codepage 125x (ANSI). When called from a command line the MSSQL extension uses the DOS code page (437 for US). The MS SQL Server client libraries can be configured to do an automatic ANSI to OEM conversion. If that option is enabled you will see the same characters from both web server and command line. If it is disabled the output will not look the same. Previous Comments: ------------------------------------------------------------------------ [2003-07-03 05:04:11] andrea dot balducci at antos dot it 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 this bug report at http://bugs.php.net/?id=24476&edit=1