c++ convert wchar_t to UTF-8 for DB

From: "ciifrancesco(at)tiscali(dot)it" <ciifrancesco(at)tiscali(dot)it>
To: pgsql-general(at)postgresql(dot)org
Cc: pierce(at)hogranch(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: c++ convert wchar_t to UTF-8 for DB
Date: 2013-08-07 15:49:27
Message-ID: 27331728.77841375890567074.JavaMail.defaultUser@defaultHost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,
I write with reference to the message readable at
http://www.postgresql.org/message-id/4BF575E6.5060203@hogranch.com

I am in the situation described in the message. I have a char* in C++ and i want to put in my db, but most of the non ASCII charachers are broken.
So i used wchar_t, but the following function doesn't exist:

PGresult *PQexec(PGconn *conn, const wchar_t *query);

In the message I referred at the beginning of this e-mail, one the answer is clear about what to do (convert wchar_t to UTF-8), but it's not explained how to do that.
I am doing this on Linux.

Thanks,
Francesco F.

Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale più di uno spot in TV. Per ogni nuovo abbonato 30 € di premio per te e per lui! Un amico al mese e parli e navighi sempre gratis: http://freelosophy.tiscali.it/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Geoghegan 2013-08-07 15:51:40 Re: PostrgreSQL Commercial restrictions?
Previous Message Adrian Klaver 2013-08-07 15:43:22 Re: PostrgreSQL Commercial restrictions?