Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 3A1979F9583 for ; Tue, 21 Aug 2007 17:03:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 70097-06 for ; Tue, 21 Aug 2007 17:03:22 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web54606.mail.re2.yahoo.com (web54606.mail.re2.yahoo.com [206.190.49.176]) by postgresql.org (Postfix) with SMTP id 161589F954F for ; Tue, 21 Aug 2007 17:03:25 -0300 (ADT) Received: (qmail 21981 invoked by uid 60001); 21 Aug 2007 20:03:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=0QnNQA17DMDtMdq0s14KnihY19RXFmPlfnzbSdfAqg2MdUXX/bBFtUFDW2pQGk7bSMwDvmkoWRq6G2gLhCFwgeyyMbA8oxhlRc6KuDDN4CSw4lHuxzlye0dXVL64LB2iaaO3aA6mYt39LUvN7uqmpkL0WMA4cRD8ipyYxofK+zI=; X-YMail-OSG: eKH8.mYVM1nyhqAhe29Bp6D1m3i5MSv.yCLvzLGMrZaEx2V80L0H7URSvaiwf6K6vCajmbnn9PIws5K_bf.cVE9TAGf9YD6f_R2b6O_bUgUz.60muEnn2ZBU.DGiU3anhLVtx0cWWlb_eDIBkyd2E5Cu7g-- Received: from [24.34.130.89] by web54606.mail.re2.yahoo.com via HTTP; Tue, 21 Aug 2007 13:03:21 PDT Date: Tue, 21 Aug 2007 13:03:21 -0700 (PDT) From: Rob Subject: PQexecParams and wchar_t To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1827595169-1187726601=:21426" Content-Transfer-Encoding: 8bit Message-ID: <736324.21426.qm@web54606.mail.re2.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/7 X-Sequence-Number: 6601 --0-1827595169-1187726601=:21426 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-1827595169-1187726601=:21426 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-1827595169-1187726601=:21426--