#27324 [Opn->Bgs]: MSSQL CLI encoding Problem
| From: | sniper@php.net | Date: | Fri, 20 Feb 2004 05:48:21 +0000 |
| Subject: | #27324 [Opn->Bgs]: MSSQL CLI encoding Problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-55212@lists.php.net to get a copy of this message | ||
ID: 27324
Updated by: sniper@php.net
Reported By: markus dot amsler at oribi dot org
-Status: Open
+Status: Bogus
Bug Type: MSSQL related
Operating System: Windows
PHP Version: 4.3.4
New Comment:
Feature.
Previous Comments:
------------------------------------------------------------------------
[2004-02-19 19:07:09] markus dot amsler at oribi dot org
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 this bug report at http://bugs.php.net/?id=27324&edit=1