Skip to Content.
Sympa Menu

freetds - Re: [freetds] Unable to connect to Sql Server via PHP when client chartset = CP1252

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Unable to connect to Sql Server via PHP when client chartset = CP1252
  • Date: Tue, 22 Nov 2011 16:21:14 +0100

2011/11/22 Chris Ballard <cballard AT datix.co.uk>:
> 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": “”‘’.
>

ASCII is a standard, there are no non-standard ASCII characters :)
Smart quote is a no-ASCII character. Question marks usually appear
when something encoding are not correct. Enabling FreeTDS logs could
help understanding how FreeTDS is currently sending data.

> Is there any reason these particular characters would be causing an issue?
>
> Cheers,
> Chris
>
>

bye
freddy77




Archive powered by MHonArc 2.6.24.

Top of Page