Skip site navigation (1) Skip section navigation (2)

Problem reading utf8 on windows XP

From: p n <pe_no(at)hotmail(dot)com>
To: <pgsql-odbc(at)postgresql(dot)org>
Subject: Problem reading utf8 on windows XP
Date: 2009-06-16 08:57:17
Message-ID: COL120-W5998C65B2F1D002D2256F0843F0@phx.gbl (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc
Excuse me, if I haven't fully understood the subject here...

I have a postgres db 8.1.11 on Linux. The data is utf8-encoded in the db. 
I have no problems reading or writing utf8 on Linux.

Now, when I try to read data on a machine running windows xp, with odbc version
I cannot manage to read utf8. How do I do that?

I am a bit lost concerning how to configure odbc.
Which driver am I supposed to use to just get the "plain" utf8 right out of the database _without any conversions_?
Now it seems like I am getting some kind of mbcs or ISO-8859-1 encoded data or something like that.

I tried to use the Unicode driver. Is that the right one?

I am using visual studio 2005. There I have an option to set character encoding. Now, if I choose to set it to UNICODE
I will get a compilation error, since then SQLConnect will be defiend as SQLConnectW, which in turn expects that I use WCHAR instead of CHAR and similar errors. I think I would like to just get utf8 data back in CHARs, not WCHARs.

Below is an excerpt of how I try to read data back. This seems to work on Linux where 
everything seemingly work out as I expect.
 rc = SQLGetData(_statementHandle, column, SQL_C_CHAR, valueBuf.get(), bufSize, &length);

Moreover, I have not foun any documentation that brings clarity to the subject, so if you have any 
hints to where I could find documentation with examples I would be glad.

Best regards,

Vem är du? Gör personlighetstestet på MSN Dejting!

pgsql-odbc by date

Next:From: Russell S HallDate: 2009-06-29 17:32:50
Subject: asp classic and postgreSQL
Previous:From: J.J.RousseauDate: 2009-06-12 16:42:28
Subject: ODBL windows has no drop down choices

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group