Inserting & Retrieving Unicode with libpq
Inserting & Retrieving Unicode with libpq
От:
"Christopher Bland" <themanatuf@juno.com>
Дата:
I've been trying to figure out all day how to insert and retrieve
unicode data from my table? My database is defined as:
List of databases
Name | Owner | Encoding
-----------+----------+-----------
mydata | postgres | UTF8
The exported methods from libpq either accept char* as the input or
return char*. I would like to be able to pass in wchar_t* and return
wchar_t* parameters. Is this possible with the current libpq module?
I've tried using the 'wcstombs' function to convert wide chars to
multi-byte, but that hasn't been working for me (all of my data is wide
chars).
Any help or suggestions would be much apprecaited.
________________________________________________________________________
Try Juno Platinum for Free! Then, only $9.95/month!
Unlimited Internet Access with 1GB of Email Storage.
Visit http://www.juno.com/value to sign up today!
Re: Inserting & Retrieving Unicode with libpq
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Christopher Bland" writes: > I would like to be able to pass in wchar_t* and return > wchar_t* parameters. Is this possible with the current libpq module? No. You'll need to convert the data to/from utf8 form yourself. regards, tom lane
Re: Inserting & Retrieving Unicode with libpq
От:
"Christopher Bland" <themanatuf@juno.com>
Дата:
Thanks for the info. That actually wasn't my problem like I had thought. Instead, I was writing past the bounds of an array and hadn't realized it. Thank you for the quick response. ________________________________________________________________________ Try Juno Platinum for Free! Then, only $9.95/month! Unlimited Internet Access with 1GB of Email Storage. Visit http://www.juno.com/value to sign up today!