Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uwx0n-0007vP-3H for pgsql-odbc@arkaria.postgresql.org; Wed, 10 Jul 2013 16:13:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Uwx0m-0003nt-DG for pgsql-odbc@arkaria.postgresql.org; Wed, 10 Jul 2013 16:13:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uwx0k-0003nj-Ju for pgsql-odbc@postgresql.org; Wed, 10 Jul 2013 16:12:58 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by magus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Uwx0e-0003rM-Pj for pgsql-odbc@postgresql.org; Wed, 10 Jul 2013 16:12:58 +0000 Received: (qmail 6671 invoked by uid 512); 10 Jul 2013 16:12:48 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 10 Jul 2013 16:12:48 -0000 Received: from unknown (HELO ?192.168.1.3?) (110.5.25.94) by sd.tpf.co.jp with SMTP; 10 Jul 2013 16:12:48 -0000 Message-ID: <51DD87FD.1010600@tpf.co.jp> Date: Thu, 11 Jul 2013 01:12:45 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: FAU CC: pgsql-odbc@postgresql.org Subject: Re: UNICODE References: <1373387342.977.12.camel@elitebook> <51DCD4A7.4070404@tpf.co.jp> <1373429843.2145.7.camel@elitebook> In-Reply-To: <1373429843.2145.7.camel@elitebook> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org (2013/07/10 13:17), FAU wrote: > On Wed, 2013-07-10 at 12:27 +0900, Inoue, Hiroshi wrote: >> Hi, >> >> (2013/07/10 1:29), FAU wrote: >>> Hello, >>> >>> I'm trying to understand how (unix)ODBC and psqlodbc work together >>> regarding UNICODE. >>> >>> So from what I understand is that ODBC UNICODE is/was inherently >>> UCS-2LE. >> >> Currently UTF-16LE or UTF-16BE according to the endianness of the >> machine. >> >>> Does the UNICODE driver version (which is psqlodbcw.so I >>> assume) expect/send UCS-2LE or (as I read somewhere) UTF-8, or does it >>> expect/send whatever the back-end database is setup to? >> >> The unicode driver expects UTF-16 not UTF-8. >> If you are to pass/accept UTF-8 string parameters, use the ANSI >> version of the driver and set client_encoding to 'UTF-8'. > > What if the back end database is not setup to unicode (e.g. 8859-1 or > whatever) and the odbc client decides to use the wide/utf-16 API > does this work out for the client? Yes as long as the client passes valid strings for the database. > If it does then this would mean that > there would be some conversion along the path (either done by the driver > manager, the driver or the database). Yes the driver does the conversion between UTF-16 and UTF-8 and the PG database does the conversion between UTF-8 and the database encoding. Though the PG database provides the conversion functionality between the client encoding and the server encoding, it doesn't support UTF-16 unfortunately. regards, Hiroshi INoue -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc