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

* Linux Unicode character size
@ 2008-01-03 14:56 FabijanicA@nucorsteel.com
  2008-01-03 17:34 ` Re: Linux Unicode character size Andrei Kovalevski <andyk@commandprompt.com>
  0 siblings, 1 reply; 3+ messages in thread

From: FabijanicA@nucorsteel.com @ 2008-01-03 14:56 UTC (permalink / raw)
  To: pgsql-odbc

What is the character size expected by Unicode driver on Linux (or any 
UNIX for that matter), i.e. does Unicode driver operate with UTF16 or 32?

Thanks in advance,

Alex
-----------------------------------------------------------------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE  This e-mail contains privileged and confidential information which is the property of Nucor, intended only for the use of the intended recipient(s).  Unauthorized use or disclosure of this information is prohibited. If you are not an intended recipient, please immediately notify Nucor and destroy any copies of this email.  Receipt of this e-mail shall not be deemed a waiver by Nucor of any privilege or the confidential nature of the information.

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

* Re: Linux Unicode character size
  2008-01-03 14:56 Linux Unicode character size FabijanicA@nucorsteel.com
@ 2008-01-03 17:34 ` Andrei Kovalevski <andyk@commandprompt.com>
  2008-01-03 18:44   ` Re: Linux Unicode character size FabijanicA@nucorsteel.com
  0 siblings, 1 reply; 3+ messages in thread

From: Andrei Kovalevski @ 2008-01-03 17:34 UTC (permalink / raw)
  To: FabijanicA@nucorsteel.com; +Cc: pgsql-odbc

    Hello,

    First of all both driver and ODBC driver manager should be built 
correctly to support UNICODE on your system. Here are some lines from 
sqltypes.h (unixODBC 2.2.12):

#ifdef SQL_WCHART_CONVERT 
/*
 * Use this if you want to use the C/C++ portable definition of  a wide 
char, wchar_t
 *  Microsoft hardcoded a definition of  unsigned short which may not be 
compatible with
 *  your platform specific wide char definition.
 */
#include <wchar.h>
#endif

    So, if you are building unixODBC with SQL_WCHART_CONVERT - you 
should specify the same option for psqlodbc.
If SQLWCHAR = wchar_t, then  sizeof(SQLWCHAR) = 4. If SQLWCHAR = 
unsigned short, then sizeof (SQLWCHAR) = 2. SQLWCHAR on Windows is 
always 2 bytes wide.

FabijanicA@nucorsteel.com wrote:
>
> What is the character size expected by Unicode driver on Linux (or any 
> UNIX for that matter), i.e. does Unicode driver operate with UTF16 or 32?
>
> Thanks in advance,
>
> Alex-----------------------------------------------------------------------------------------------------------------------------------------
> CONFIDENTIALITY NOTICE This e-mail contains privileged and 
> confidential information which is the property of Nucor, intended only 
> for the use of the intended recipient(s). Unauthorized use or 
> disclosure of this information is prohibited. If you are not an 
> intended recipient, please immediately notify Nucor and destroy any 
> copies of this email. Receipt of this e-mail shall not be deemed a 
> waiver by Nucor of any privilege or the confidential nature of the 
> information.


-- 
Andrei Kovalevski
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/




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

* Re: Linux Unicode character size
  2008-01-03 14:56 Linux Unicode character size FabijanicA@nucorsteel.com
  2008-01-03 17:34 ` Re: Linux Unicode character size Andrei Kovalevski <andyk@commandprompt.com>
@ 2008-01-03 18:44   ` FabijanicA@nucorsteel.com
  0 siblings, 0 replies; 3+ messages in thread

From: FabijanicA@nucorsteel.com @ 2008-01-03 18:44 UTC (permalink / raw)
  To: Andrei Kovalevski <andyk@commandprompt.com>; +Cc: pgsql-odbc

Andrei Kovalevski <andyk@commandprompt.com> wrote on 01/03/2008 12:34:58 
PM:

>     So, if you are building unixODBC with SQL_WCHART_CONVERT - you 
> should specify the same option for psqlodbc.
> If SQLWCHAR = wchar_t, then  sizeof(SQLWCHAR) = 4. If SQLWCHAR = 
> unsigned short, then sizeof (SQLWCHAR) = 2. SQLWCHAR on Windows is 
> always 2 bytes wide.

Andrei,

Thank you for the reply. I am aware of the above. But, since I have a 
binary distro (Ubuntu), I am not building either. To be platform 
transparent, it's simplest to keep things to be 2 bytes wide (which, 
AFAICT, is default for unixODBC) and I was wondering what is the "default" 
(if there is such a thing) for psql. Currently, my problem is that I get 
SQL_NO_DATA from SQLDriverConnectW when I pass UTF-16 string.

Alex


-----------------------------------------------------------------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE  This e-mail contains privileged and confidential information which is the property of Nucor, intended only for the use of the intended recipient(s).  Unauthorized use or disclosure of this information is prohibited. If you are not an intended recipient, please immediately notify Nucor and destroy any copies of this email.  Receipt of this e-mail shall not be deemed a waiver by Nucor of any privilege or the confidential nature of the information.

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


end of thread, other threads:[~2008-01-03 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-01-03 14:56 Linux Unicode character size FabijanicA@nucorsteel.com
2008-01-03 17:34 ` Andrei Kovalevski <andyk@commandprompt.com>
2008-01-03 18:44   ` FabijanicA@nucorsteel.com

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