wxWidgets and PostgreSQL

Ayen Yang ayen.krida at gmail.com
Fri Nov 2 07:47:15 PDT 2007


By the way, the database is encoded in UTF8 and I'm compiling the Unicode built.
Thanks.


On Nov 2, 2007 9:46 PM, Ayen Yang <ayen.krida at gmail.com> wrote:
> Dear VZ,
>
> I've just tried to use wxString::FromAscii() and the result is still
> the same. I also tried wxString::FromUTF8() and the result is an empty
> wxString.
>
> I'm a newbie in wxWidgets programming. Could you tell me how to put
> the value to a wxString:
> - if the PQgetvalue() returns UTF8?
> - if the PQgetvalue() returns ASCII?
>
> Thank you very much.
>
> Regards,
> Ayen
>
>
>
>
> On Nov 2, 2007 8:52 PM, Vadim Zeitlin <vadim at wxwidgets.org> wrote:
> > On Fri, 2 Nov 2007 20:48:09 +0700 Ayen Yang <ayen.krida at gmail.com> wrote:
> >
> > AY> The PQgetvalue() function returns char*
> >
> >  This is not enough. A non-ASCII "char *" string can be encoded either
> > using UTF-8 or any of single byte (e.g. ISO-8859-X) encodings. Of course,
> > if your string contains only ASCII characters it doesn't matter as all
> > these encodings encode 7 bit ASCII characters as themselves so you can just
> > use wxString::FromAscii(). But if you want it to work with any strings you
> > must know what encoding is used and use the corresponding conversion object
> > in the wxString ctor (assuming you use the Unicode build, you shouldn't be
> > trying to handle strings in arbitrary encodings in ANSI build as while it
> > is possible, it's much more complicated).
> >
> >
> >  Regards,
> > VZ
> >
> > --
> > TT-Solutions: wxWidgets consultancy and technical support
> >                http://www.tt-solutions.com/
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> > For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
> >
> >
>




More information about the wx-users mailing list