pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedpsqlodbc patches to unsiged short wchar definition on linux platform
2+ messages / 2 participants
[nested] [flat]
* psqlodbc patches to unsiged short wchar definition on linux platform
@ 2006-04-12 08:45 Karol Szkudlarek <karol@mikronika.com.pl>
0 siblings, 1 reply; 2+ messages in thread
From: Karol Szkudlarek @ 2006-04-12 08:45 UTC (permalink / raw)
To: pgsql-odbc
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: psqlodbc patches to unsiged short wchar definition on
@ 2006-04-13 23:34 Hiroshi Inoue <inoue@tpf.co.jp>
parent: Karol Szkudlarek <karol@mikronika.com.pl>
0 siblings, 0 replies; 2+ messages in thread
From: Hiroshi Inoue @ 2006-04-13 23:34 UTC (permalink / raw)
To: karol@mikronika.com.pl; +Cc: pgsql-odbc
Karol Szkudlarek wrote:
> 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:
Could you try the expermental enhanced branch ?
regards,
Hiroshi Inoue
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-04-13 23:34 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-04-12 08:45 psqlodbc patches to unsiged short wchar definition on linux platform Karol Szkudlarek <karol@mikronika.com.pl>
2006-04-13 23:34 ` Re: psqlodbc patches to unsiged short wchar definition on Hiroshi Inoue <inoue@tpf.co.jp>
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