[freetds] Problems executing a query
James K. Lowden
jklowden at freetds.org
Fri Jun 17 07:51:42 EDT 2005
Riccardo Penco wrote:
> If in a php script I write:
> $sql = "SELECT Città from PDV";
> $res = mssql_query($sql, $conn);
> I obtain the following error message:
> Warning: mssql_query(): Error converting client characters into server's
> character set. Some character(s) could not be converted. (severity 16)
Does the query work in tsql? It should.
SQL Server 2000 encodes database object names in UCS-2, which obviously
can represent 'Città'. The error message may be telling you that the à is
arriving not as UTF-8 (2 bytes) but as ISO 8859-1 (1 byte, high bit on).
Attempting to interpret ISO 8859-1 as UTF-8 will elicit that message.
A TDSDUMP log will provide more detailed information about the failed
More information about the FreeTDS