From: Karol Szkudlarek <karol@mikronika.com.pl>
To: pgsql-odbc@postgresql.org
Subject: psqlodbc patches to unsiged short wchar definition on linux platform
Date: Wed, 12 Apr 2006 10:45:46 +0200
Message-ID: <443CBE3A.9070401@mikronika.com.pl> (raw)
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
inline patch 1: convert_my.c (+9/-1 lines) download inline-1.patch--- 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: karol@mikronika.com.pl
Subject: Re: psqlodbc patches to unsiged short wchar definition on linux platform
In-Reply-To: <443CBE3A.9070401@mikronika.com.pl>
References: <443CBE3A.9070401@mikronika.com.pl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox