X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BD0BD11F6654 for ; Wed, 12 Apr 2006 05:45:56 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.12 X-Spam-Level: X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id v6Y05OFvKg38 for ; Wed, 12 Apr 2006 05:45:51 -0300 (ADT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 977F111F662B for ; Wed, 12 Apr 2006 05:45:53 -0300 (ADT) Received: from ssl.mikronika.com.pl (ro.mikronika.com.pl [213.17.224.85]) by svr4.postgresql.org (Postfix) with ESMTP id AC02F5AF190 for ; Wed, 12 Apr 2006 08:45:53 +0000 (GMT) Received: from [192.168.0.56] (karol.mikronika.com.pl [192.168.0.56]) (authenticated bits=0) by ssl.mikronika.com.pl (8.13.4/8.13.4) with ESMTP id k3C8oT6N022402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 12 Apr 2006 10:50:30 +0200 Message-ID: <443CBE3A.9070401@mikronika.com.pl> Date: Wed, 12 Apr 2006 10:45:46 +0200 From: Karol Szkudlarek Reply-To: karol@mikronika.com.pl Organization: Mikronika User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051119) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: psqlodbc patches to unsiged short wchar definition on linux platform Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Archive-Number: 200604/40 X-Sequence-Number: 7567 Hello! I successfully used the driver psqlodbc-08.01.0200 with postgres database in UTF-8 encoding and with unsigned short wchar definition after applying the following patches to the driver: 1) config.h //#define SQL_WCHART_CONVERT 2) convert.h --- convert.c 2006-01-08 11:09:52.000000000 +0100 +++ convert_my.c 2006-04-07 15:35:56.000000000 +0200 @@ -195,6 +195,14 @@ #endif /* WIN32 */ #endif /* ODBCINT64 */ +size_t mywcslen( SQLWCHAR* buffer ) +{ + size_t ret = 0; + while (*buffer++) + ++ret; + return ret; +} + /* * TIMESTAMP <-----> SIMPLE_TIME * precision support since 7.2. @@ -2668,7 +2676,7 @@ #ifdef UNICODE_SUPPORT case SQL_C_WCHAR: if (SQL_NTS == used) - used = WCLEN * wcslen((SQLWCHAR *) buffer); + used = WCLEN * mywcslen((SQLWCHAR *) buffer); buf = allocbuf = ucs2_to_utf8((SQLWCHAR *) buffer, used / WCLEN, (UInt4 *) &used, FALSE); used *= WCLEN; break; My testing configuration: server and client platform: Linux psqlodbc configure: ./configure --with-unixodbc --enable-unicode unixodbc: 2.2.11. Please consider putting those changes to the driver. Without that driver doesn't work correctly. Regards, Karol Szkudlarek -- Karol Szkudlarek Badawczo - Rozwojowa Spó³dzielnia Pracy Mikroprocesorowych Systemów Automatyki "Mikronika" ul. Wykopy 2/4 60-001 POZNAŃ tel. +48 61 6655600 fax +48 61 6655602 e-mail karol@mikronika.com.pl