pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
experimental Unicode support
5+ messages / 2 participants
[nested] [flat]

* experimental Unicode support
@ 2004-02-02 23:23 Jon Willeke <willeke@users.sourceforge.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Jon Willeke @ 2004-02-02 23:23 UTC (permalink / raw)
  To: pgsql-odbc

I'm attaching a few tweaks to build psqlodbc with Unicode support on 
Unix.  I changed some code that assumes two-byte SQLWCHAR and I changed 
configure.ac and Makefile.am, as necessary.

I tested this with unixODBC 2.2.7 on SuSE Linux 8.2.  I built unixODBC 
--with-iconv-ucode-enc=UCS-4LE and with SQL_WCHART_CONVERT defined, so that 
SQLWCHAR is wchar_t.  I have not tested it with UCS-2 / unsigned short.

I also tested this with iODBC 3.51.1, which always uses wchar_t on Unix.

One caveat, if anyone actually plays with this: sqlext.h should include 
sqlucode.h, so I haven't patched psqlodbc to do so.  The next release of 
unixODBC will contain this fix, and I've mentioned it to the iODBC maintainer.

I realize that the demand for Unicode ODBC on Unix for PostgreSQL is pretty 
small.  Nonetheless, I've learned a few things poking around the code, and 
I figured someone might be interested.

Attachments:

  psqlodbc-uni.patch.gz (application/octet-stream, 3.1K) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: experimental Unicode support
@ 2004-02-03 09:06 Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 5+ messages in thread

From: Dave Page @ 2004-02-03 09:06 UTC (permalink / raw)
  To: Jon Willeke <willeke@users.sourceforge.net>; pgsql-odbc

Hi John,

I haven't tried this on a Unix system yet, but unfortunately it does
break the Win32 Unicode build:

Building the PostgreSQL Unicode 3.0 Driver for Win32...

No configuration specified. Defaulting to Unicode30.

        cl.exe /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D
"_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSQLODBC_EXPORTS" /D
"ODBCVER=0x0300" /D UNICODE_SUPPORT" /D "DRIVER_CURSOR_IMPLEMENT" /D
"WIN_MULTITHREAD_SUPPORT"  /Fp".\Unicode30\psqlodbc.pch" /YX
/Fo".\Unicode30\\" /Fd".\Unicode30\\" /FD /c win_unicode.c
win_unicode.c
win_unicode.c(28) : error C2059: syntax error : 'type'
NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
Stop.

Regards, Dave. 

> -----Original Message-----
> From: Jon Willeke [mailto:willeke@users.sourceforge.net] 
> Sent: 02 February 2004 23:23
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] experimental Unicode support
> 
> I'm attaching a few tweaks to build psqlodbc with Unicode 
> support on Unix.  I changed some code that assumes two-byte 
> SQLWCHAR and I changed configure.ac and Makefile.am, as necessary.
> 
> I tested this with unixODBC 2.2.7 on SuSE Linux 8.2.  I built 
> unixODBC --with-iconv-ucode-enc=UCS-4LE and with 
> SQL_WCHART_CONVERT defined, so that SQLWCHAR is wchar_t.  I 
> have not tested it with UCS-2 / unsigned short.
> 
> I also tested this with iODBC 3.51.1, which always uses 
> wchar_t on Unix.
> 
> One caveat, if anyone actually plays with this: sqlext.h 
> should include sqlucode.h, so I haven't patched psqlodbc to 
> do so.  The next release of unixODBC will contain this fix, 
> and I've mentioned it to the iODBC maintainer.
> 
> I realize that the demand for Unicode ODBC on Unix for 
> PostgreSQL is pretty small.  Nonetheless, I've learned a few 
> things poking around the code, and I figured someone might be 
> interested.
> 



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: experimental Unicode support
@ 2004-02-03 14:33 ` Jon Willeke <willeke@users.sourceforge.net>
  1 sibling, 0 replies; 5+ messages in thread

From: Jon Willeke @ 2004-02-03 14:33 UTC (permalink / raw)
  To: pgsql-odbc

I haven't looked at the code, yet, but I'm pretty sure I know the 
problem.  I added the HAVE_ISWASCII condition to make win_unicode.c work 
for Linux, which doesn't support this extension.  However, Windows uses a 
different build system, so I need to guard it with HAVE_CONFIG, or 
something like that.

I'll fix this and try to find a Windows build machine.

At 09:06 AM 2/3/2004 +0000, Dave Page wrote:
>I haven't tried this on a Unix system yet, but unfortunately it does
>break the Win32 Unicode build:
>
>Building the PostgreSQL Unicode 3.0 Driver for Win32...
>
>No configuration specified. Defaulting to Unicode30.
>
>         cl.exe /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D
>"_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSQLODBC_EXPORTS" /D
>"ODBCVER=0x0300" /D UNICODE_SUPPORT" /D "DRIVER_CURSOR_IMPLEMENT" /D
>"WIN_MULTITHREAD_SUPPORT"  /Fp".\Unicode30\psqlodbc.pch" /YX
>/Fo".\Unicode30\\" /Fd".\Unicode30\\" /FD /c win_unicode.c
>win_unicode.c
>win_unicode.c(28) : error C2059: syntax error : 'type'
>NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
>Stop.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: experimental Unicode support
@ 2004-02-03 20:01 ` Jon Willeke <willeke@users.sourceforge.net>
  1 sibling, 0 replies; 5+ messages in thread

From: Jon Willeke @ 2004-02-03 20:01 UTC (permalink / raw)
  To: pgsql-odbc

I'm attaching an updated patch.  I haven't yet tested it on Windows, but 
the fix is simple enough.

I have been unable to build psqlodbc satisfactorily with the PostgreSQL 
config files, as the configure script fails to find support for shared 
libraries.  I did a quick test with a statically linked client.

When I stripped out the PGAC* macros and inlined PGAC_VAR_INT_TIMEZONE, I 
was able to build and test a shared library.  (I have not included those 
changes.)

At 2/3/2004, Jon Willeke wrote:
>I haven't looked at the code, yet, but I'm pretty sure I know the 
>problem.  I added the HAVE_ISWASCII condition to make win_unicode.c work 
>for Linux, which doesn't support this extension.  However, Windows uses a 
>different build system, so I need to guard it with HAVE_CONFIG, or 
>something like that.
>
>I'll fix this and try to find a Windows build machine.

Attachments:

  psqlodbc-uni2.patch.gz (application/octet-stream, 2.5K) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: experimental Unicode support
@ 2004-02-04 08:56 Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 5+ messages in thread

From: Dave Page @ 2004-02-04 08:56 UTC (permalink / raw)
  To: Jon Willeke <willeke@users.sourceforge.net>; pgsql-odbc

 

> -----Original Message-----
> From: Jon Willeke [mailto:willeke@users.sourceforge.net] 
> Sent: 03 February 2004 20:02
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] experimental Unicode support
> 
> I'm attaching an updated patch.  I haven't yet tested it on 
> Windows, but the fix is simple enough.

Thanks John - that got it.

Patch applied :-)

Regards, Dave.



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2004-02-04 08:56 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-02-02 23:23 experimental Unicode support Jon Willeke <willeke@users.sourceforge.net>
2004-02-03 09:06 Re: experimental Unicode support Dave Page <dpage@vale-housing.co.uk>
2004-02-03 14:33 ` Jon Willeke <willeke@users.sourceforge.net>
2004-02-03 20:01 ` Jon Willeke <willeke@users.sourceforge.net>
2004-02-04 08:56 Re: experimental Unicode support Dave Page <dpage@vale-housing.co.uk>

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