Re: trouble with UTF-8 input data with mssql_bind

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <1260258836.4421.2.camel@freddy>
Il giorno lun, 07/12/2009 alle 21.34 -0500, James K. Lowden ha scritto:
> Tomasz Kurkiewicz wrote:
> > 
> > I'm using FreeTDS 0.82 to execute a stored procedure on a MS SQL Server 
> > 2005. Unfortunately, I keep getting error messages while executing a 
> > stored procedure using mssql_bind.
> > Web server is Fedora 8, PHP 5.3.0, freetds 0.82, database server is 
> > called MSSQL.
> ... 
> > Client encoding is UTF-8, parameters are all nvarchars, it fails on a 
> > first nvarchar parameter (look at freetds.log).
> > 
> > freetds.log says:
> > "Error converting characters into server's character set. Some 
> > character(s) could not be converted"
> > "The incoming tabular data stream (TDS) remote procedure call (RPC) 
> > protocol stream is incorrect. Parameter 2 ("@user_agent"): Data type 
> > 0xA7 has an invalid data length or metadata length."
> 
> I would be interested in a TDSDUMP log that includes the parameter binding
> functions and the error returned by the server.  
> 
> It's likely you've hit a long-standing problem.  There's not much encoding
> conversion built into the parameter binding functions in db-lib.  The
> expectation is that the bound buffer holds data encoded in the same form
> as the column to which it applies.  That could be changed, but someone has
> to want to....
> 

Fixed in 0.82 CVS version, this is a problem of no patched version.

Sun Aug 17 10:42:41 CET 2008  Frediano Ziglio <freddy77_A_gmail_D_com>
       * src/tds/query.c: do not loose sync on conversion errors

freddy77
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.