Re: Unable to connect to Sql Server via PHP when client chartset = CP1252

Chris Ballard <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
James K. Lowden <jklowden <at> freetds.org> writes:

> 
> On Fri, 18 Nov 2011 17:32:43 +0000 (UTC)
> Chris Ballard <cballard <at> datix.co.uk> wrote:
> 
> > We're experiencing problems saving some characters (e.g. ?) to the DB
> > - they're entered as question marks.  
> > 
> > I've attempted to remedy this by adding a client charset definition,
> > but setting this to CP1252 results in the connection to SQL Server
> > not working at all.  
> 
> Are you linked to a real iconv library?  The built-in one won't handle
> 1252.  TDSDUMP is your friend there, also "tsql -C".  
> 
> Second, what collation are you using on the column holding the, ahem,
> smart quotes?  Are those characters in fact part of that collation?  
> 
> --jkl
> 

Hi James,

Thanks for your response.  PHP has native iconv functionality which I've tried 
using, but to no avail.  The collation that's used is Latin1_General_CI_AS - I 
don't think this is the issue though since the characters save ok when running 
the statement against the DB directly (i.e. via Management Studio), so I'd guess 
it's something to do the way the driver is interpreting/presenting these 
characters?

I've done some testing with a whole load of other non-standard ASCII characters 
and they seem to save ok - the only ones that get saved as question marks appear 
to be these "smart quotes": “”‘’.

Is there any reason these particular characters would be causing an issue?

Cheers,
Chris




_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.