Linux Unicode character size

Linux Unicode character size

am 03.01.2008 15:56:43 von FabijanicA

--=_alternative 00521916852573C5_=
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

What is the character size expected by Unicode driver on Linux (or any=20
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 in=
formation 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 not=
ify Nucor and destroy any copies of this email. Receipt of this e-mail sha=
ll not be deemed a waiver by Nucor of any privilege or the confidential nat=
ure of the information.
--=_alternative 00521916852573C5_=
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable



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?


serif">Thanks in advance,

=
Alex
------------------------------------------------------------ ----=
------------------------------------------------------------ ------------- R>
CONFIDENTIALITY NOTICE This e-mail contains privileged and confidential in=
formation 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 not=
ify Nucor and destroy any copies of this email. Receipt of this e-mail sha=
ll not be deemed a waiver by Nucor of any privilege or the confidential nat=
ure of the information.

--=_alternative 00521916852573C5_=--

Re: Linux Unicode character size

am 03.01.2008 18:34:58 von Andrei Kovalevski

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
#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/


---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Re: Linux Unicode character size

am 03.01.2008 19:44:51 von FabijanicA

--=_alternative 0066FBF2852573C5_=
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

Andrei Kovalevski wrote on 01/03/2008 12:34:58=20
PM:

> So, if you are building unixODBC with SQL=5FWCHART=5FCONVERT - you=20
> should specify the same option for psqlodbc.
> If SQLWCHAR =3D wchar=5Ft, then sizeof(SQLWCHAR) =3D 4. If SQLWCHAR =3D =

> unsigned short, then sizeof (SQLWCHAR) =3D 2. SQLWCHAR on Windows is=20
> always 2 bytes wide.

Andrei,

Thank you for the reply. I am aware of the above. But, since I have a=20
binary distro (Ubuntu), I am not building either. To be platform=20
transparent, it's simplest to keep things to be 2 bytes wide (which,=20
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=20
SQL=5FNO=5FDATA from SQLDriverConnectW when I pass UTF-16 string.

Alex


------------------------------------------------------------ ---------------=
------------------------------------------------------------ --
CONFIDENTIALITY NOTICE This e-mail contains privileged and confidential in=
formation 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 not=
ify Nucor and destroy any copies of this email. Receipt of this e-mail sha=
ll not be deemed a waiver by Nucor of any privilege or the confidential nat=
ure of the information.
--=_alternative 0066FBF2852573C5_=
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable



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

>     So, if you are b=
uilding unixODBC with SQL=5FWCHART=5FCONVERT
- you
> should specify the same option for psqlodbc.
> If SQLW=
CHAR =3D wchar=5Ft, then  sizeof(SQLWCHAR) =3D 4. If SQLWCHAR
=3D
> unsigned short, then sizeof (SQLWCHAR) =3D 2. SQLWCHAR on Wind=
ows 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=5FNO=5FDATA from SQLDriverConnectW when I pass UT=
F-16
string.


Alex

-----=
------------------------------------------------------------ ---------------=
---------------------------------------------------------

CONFIDENTIALITY NOTICE This e-mail contains privileged and confidential in=
formation 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 not=
ify Nucor and destroy any copies of this email. Receipt of this e-mail sha=
ll not be deemed a waiver by Nucor of any privilege or the confidential nat=
ure of the information.

--=_alternative 0066FBF2852573C5_=--