wxWidgets and PostgreSQL

Vadim Zeitlin vadim at wxwidgets.org
Fri Nov 2 06:52:51 PDT 2007


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/





More information about the wx-users mailing list