X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E79F7DBBB6 for ; Thu, 24 Nov 2005 10:19:09 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 27979-09 for ; Thu, 24 Nov 2005 14:19:12 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1497ADBBCF for ; Thu, 24 Nov 2005 10:19:06 -0400 (AST) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EfHul-0004OE-Oi for pgsql-odbc@postgresql.org; Thu, 24 Nov 2005 15:17:31 +0100 Received: from 83.145.96.114 ([83.145.96.114]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Nov 2005 15:17:31 +0100 Received: from Marc.Herbert by 83.145.96.114 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Nov 2005 15:17:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-odbc@postgresql.org From: Marc Herbert Subject: Re: Continuing encoding fun.... Date: Thu, 24 Nov 2005 15:18:23 +0100 Lines: 49 Message-ID: <871x16yvrk.fsf@meije.emic.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 83.145.96.114 User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4 (Jumbo Shrimp, linux) Cancel-Lock: sha1:g96GMzaU+nizeN6wKBcaEwFS4Ts= Cc: unixodbc-dev@unixodbc.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.253 required=5 tests=[AWL=-0.000, RCVD_NUMERIC_HELO=1.253] X-Spam-Score: 1.253 X-Spam-Level: * X-Archive-Number: 200511/206 X-Sequence-Number: 6442 [Cross-posting to unixodbc-devel. Also crossing fingers so it works] Archives of both lists here for instance: "Dave Page" writes: > > The docs are somewhat fuzzy on this point, simply stating that > > "If the driver is a Unicode driver, the Driver Manager makes function > calls as follows:" ... "Converts an ANSI function (with the A suffix) > to a Unicode function (with the W suffix) by converting the string > arguments into Unicode characters and passes the Unicode function to > the driver." > > (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcunicode_applications.asp) > > My assertion that the driver does the conversion comes from the SQL > Server driver which allows you to turn conversion on or off: > > "Perform translation for character data check box > > When selected, the SQL Server ODBC driver converts ANSI strings sent > between the client computer and SQL Server by using Unicode. The SQL > Server ODBC driver sometimes converts between the SQL Server code page > and Unicode on the client computer. This requires that the code page > used by SQL Server be one of the code pages available on the client > computer. > > When cleared, no translation of extended characters in ANSI character > strings is done when they are sent between the client application and > the server. If the client computer is using an ANSI code page (ACP) > different from the SQL Server code page, extended characters in ANSI > character strings may be misinterpreted. If the client computer is > using the same code page for its ACP that SQL Server is using, the > extended characters are interpreted correctly." > > If Microsoft intended the DM to do the conversion when they wrote the > spec, why would they then add the same functionality to their driver? Here is a hypothesis: the checkbox in SQL Server driver is actually a switch between the ANSI version and the Unicode version of this driver. That would be pretty much consistent with all the above. The only inconsistency would be: "The driver converts...", to be actually read as: "This setting triggers the conversion operated by the DM". What do you think?