From:             markus dot amsler at oribi dot org
Operating system: Windows 
PHP version:      4.3.4
PHP Bug Type:     MSSQL related
Bug description:  MSSQL CLI encoding Problem

Description:
------------
I couldn't insert special characters like äöüéàè into a MSSQL-Server.



After some investigation I found the problem happens only if php gets
called from CLI and if the SQL-Client Tools are installed on the client.



The Problem was the Automatic ANSI to OEM conversion which per default is
selected if the SQL-Client Tools are installed. After I disabled it in the
SQL Server Client Configuration -> DB Library Options, the characters got
inserted correctly.



I found this note on
http://www.schemamania.org/jkl/booksonline/SQLBOL70/html/1_client_20.htm

that explains, why it's only happening in the Console:



"Any clients running Windows NT or Windows 95/98 are considered ANSI
clients. Console-based applications, such as the isql utility, are
considered OEM clients."



I'm not sure wether this behavior is a bug or a feature. Perhaps the mssql
module could disable the Automatic conversion, so it would work out of the
box on the console.



It's related with this one (but not exactly the same)

http://bugs.php.net/bug.php?id=11868





Reproduce code:
---------------
mssql_connect ("192.9.122.108", "sa");

mssql_select_db ("umlaute");



$sq = "CREATE TABLE umlaute (id INT IDENTITY, value VARCHAR(255))";

mssql_query ($sq);



$sq = "INSERT INTO umlaute (value) VALUES ('äöüéàè')";

mssql_query ($sq);



Expected result:
----------------
äöüéàè in the database umlaute table umlaute

Actual result:
--------------
field value contains  õ÷³ÚÓÞ

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

Reply via email to