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 F3E6CDAE69 for ; Wed, 26 Oct 2005 13:36:00 -0300 (ADT) 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 84907-09 for ; Wed, 26 Oct 2005 16:35:58 +0000 (GMT) Received: from fep30-app.kolumbus.fi (fep30-0.kolumbus.fi [193.229.0.32]) by svr1.postgresql.org (Postfix) with ESMTP id B78E8DADC6 for ; Wed, 26 Oct 2005 13:35:57 -0300 (ADT) Received: from [192.168.1.3] (really [84.231.186.240]) by fep30-app.kolumbus.fi with ESMTP id <20051026163556.NXOJ15053.fep30-app.kolumbus.fi@[192.168.1.3]> for ; Wed, 26 Oct 2005 19:35:56 +0300 Message-ID: <435FB06B.6010002@kolumbus.fi> Date: Wed, 26 Oct 2005 19:35:55 +0300 From: Marko Ristola User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: About psqlodbc internal UTF-8 implementation Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.089 required=5 tests=[AWL=0.039, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/120 X-Sequence-Number: 6222 Hi I have implemented for Linux Iconv library the following thing: - psqlodbc uses UTF-8 internally. - psqlodbc talks with backend with UTF-8. - Client application uses setlocale() charset for SQLCHAR functions. - Client application uses SQLWCHAR charset for wide character functions. So the following things will be converted: - SQL statement. - Prepared SQL data. - SQL result data. The code is not very stable yet, and I don't know, wether I have time to make it more stable. Are you interested about it? The purpose, that I wanted to write such conversions, is, that I would like to have only one charset inside psqlodbc. So the parsers would need to understand only one charset, that being UTF-8. I am able to use it with basic conversions: - with correct setlocale() setting, I can fetch from UTF-8 database, LATIN1 or UTF-8 with a single ODBC driver, with Linux. So the concept seems to be okay. Currently the ODBC driver takes most of it's time on parsing activities. I measured the conversion speed: My laptop is able to do about 1,5 million conversions per second. Of course, LATIN1 is an easy case for UTF-8 conversion. Regards, Marko Ristola