wxWidgets and PostgreSQL

Vadim Zeitlin vadim at wxwidgets.org
Fri Nov 2 06:26:03 PDT 2007


On Fri, 2 Nov 2007 20:12:16 +0700 Ayen Yang <ayen.krida at gmail.com> wrote:

AY> I think the problem is in the conversion from the PQgetvalue() to
AY> wxString, but I don't know for sure.
AY> I've tried many of wxString conversion functions, but the result is
AY> still the same.

 You don't need to try many different things, you'll just confuse yourself
and anybody else trying to help you. You need to know 2 simple things: what
is the string format returned by PQgetvalue() and what build of wx do you
use. If you know this, wxString provides the conversion function you need.
If you don't, you risk to waste a lot of time stumbling in the dark.

 This is (by far) not the first time this question comes on this list and
I'm amazed that people think that you need some black magic to convert
strings between different encodings and Unicode. There is really nothing
complicated in it if you just stop a moment and try to understand what
you're doing. In particular, if you're guessing about what to do, something
is wrong. You need to know, and not to guess. So while I don't know what
does PQgetvalue() return, you really should -- but it seems that you don't.
And until you know this it's useless to try to do anything.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list