From: Rob <motorhead9876@yahoo.com>
To: pgsql-interfaces@postgresql.org
Subject: PQexecParams and wchar_t
Date: Tue, 21 Aug 2007 13:03:21 -0700 (PDT)
Message-ID: <736324.21426.qm@web54606.mail.re2.yahoo.com> (raw)
Does anyone have an example of passing a UTF8 wchar_t character string to PQexecParams() working? For the life of me I can't get it to work. The best I've gotten is the first character of the string is added to my table.
The database uses UTF8 encoding, but no combination of parameters to PQexecParams that I've found gets the whole string into my function. I'm guessing that since that PQexecParams takes an array of const char * that the interface has no way to guess that the parameters are actually wide characters. And since (for english encoding) the data is stored in the first byte of the two byte character, the interface only grabs the first byte of the wide string, thinking the second byte is a null terminator.
Specifying the length of the wchar parameter makes no difference. Is there any way to tell the interface that the parameter is a wide character string?
Any help greatly appreciated.
Rob
---------------------------------
Pinpoint customers who are looking for what you sell.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: motorhead9876@yahoo.com
Subject: Re: PQexecParams and wchar_t
In-Reply-To: <736324.21426.qm@web54606.mail.re2.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox