lapith Posted August 3, 2007 Share Posted August 3, 2007 It looks like I am having a problem reading in the ' and " from a MS SQL database. I am assuming this is because they really are "smart/curly quotes" I have everything that I can think of set to use utf-8 but I am still getting errors thrown in my face. I am new to this PHP thing and have not had any problems with mysql db's before, but I have to get my app to work with MS SQL until they get around to porting it over to mysql. Any suggestions would be greatly appriceated. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/63239-mssql-charset-conversion-problem/ Share on other sites More sharing options...
teng84 Posted August 3, 2007 Share Posted August 3, 2007 what reading??? and explain more Quote Link to comment https://forums.phpfreaks.com/topic/63239-mssql-charset-conversion-problem/#findComment-315198 Share on other sites More sharing options...
lapith Posted August 3, 2007 Author Share Posted August 3, 2007 sorry for the confusion. when I use mssql_query the page is filled with the errors that I have pasted below. I did some troubleshooting and I found that the mssql database has curly quotes (also known as smart quotes) instead of the normal quotes and those are what are being replaced with question marks. I have tried using the utf8_encode or decode, but have found that the error is given in the actual query as opposed to when I try to actually use the returned data object. Warning: mssql_query() [function.mssql-query]: WARNING! Some character(s) could not be converted into client's character set. Unconverted bytes were changed to question marks ('?'). (severity 16) in /var/www/tools/scripts/display_widget_script.php on line 32 please let me know if this is still unclear. Quote Link to comment https://forums.phpfreaks.com/topic/63239-mssql-charset-conversion-problem/#findComment-315218 Share on other sites More sharing options...
teng84 Posted August 3, 2007 Share Posted August 3, 2007 show us that line to see whats the prob Quote Link to comment https://forums.phpfreaks.com/topic/63239-mssql-charset-conversion-problem/#findComment-315225 Share on other sites More sharing options...
lapith Posted August 3, 2007 Author Share Posted August 3, 2007 $result = mssql_query($qs) or die ( "Error in query: $query. " ); is the line of code that I am using. (Not very informative, I know.) Then I go on to $rows = mssql_num_rows($result); and use a loop to cycle through the rows $row = mssql_fetch_assoc($result); Again. The problem seems to be that some of the characters in the mssql database are encoded as utf-8 Quote Link to comment https://forums.phpfreaks.com/topic/63239-mssql-charset-conversion-problem/#findComment-315232 Share on other sites More sharing options...
teng84 Posted August 3, 2007 Share Posted August 3, 2007 post the query and if possible the sample data you want to have Quote Link to comment https://forums.phpfreaks.com/topic/63239-mssql-charset-conversion-problem/#findComment-315233 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.