meloks Posted October 10, 2006 Share Posted October 10, 2006 We are using PHP 5.1.6, MS SQL 2000 and ADO (PHP COM object) as connection.The issue we are trying to resolve is to correctly save and retrieve Cyrrilic datato/from database using Web Inteface, as well as to be able to retrieve data using MS SQL DTS tool.The data type in database is defined as nvarchar and character set on webpage defined as UTF-8. If database connection is established as $ado=new COM ("ADODB.Connection"),the Cyrrilic data is stored correctly to database, but has no meaning on webpage,and if connection is established as $ado=new COM ("ADODB.Connection",NULL,CP_UTF8),data is displayed correctly on webpage, but looks as garbage in database.We believe, the problem is that UTF-8 encoding is not supported in SQL Server and UCS-2 (SQL Server Unicode encoding) is not supported in webpage. So in case where we specified code page in connection as UTF-8, the data was stored as a sequece of characters and when read back from database, was interpreted correctly on webpageAlso, we have tried PHP "mb_convert_encoding" and "iconv" functions (mb_convert_encoding($string,'UTF-8','UCS-2'); iconv('UCS-2','UTF-8',$string);)to convert data betweeen different encodings, but it was not working properly.Is there any ideas on how it can be resolved?Many thanks. Quote Link to comment https://forums.phpfreaks.com/topic/23529-unicode-support-in-php-and-ms-sql/ Share on other sites More sharing options...
argoSquirrel Posted October 16, 2006 Share Posted October 16, 2006 Appears to be a documented bug dating back to '02. [url=http://bugs.php.net/bug.php?id=18169]http://bugs.php.net/bug.php?id=18169[/url]Have you tried:[code]ADODB.Connection",NULL,CP_UTF8[/code] Quote Link to comment https://forums.phpfreaks.com/topic/23529-unicode-support-in-php-and-ms-sql/#findComment-109766 Share on other sites More sharing options...
jastu Posted December 19, 2006 Share Posted December 19, 2006 It`s my first post(in English) ..so be patient ;)I have the same problem with UTF-8 in PHP and MSSQL (and i can`t find solution) . If anybody working with this and know how can i use it together - i`ll be grateful. Quote Link to comment https://forums.phpfreaks.com/topic/23529-unicode-support-in-php-and-ms-sql/#findComment-144464 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.