| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Igor Korot <ikorot01(at)gmail(dot)com> |
| Cc: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: PQexecPrepared() question |
| Date: | 2025-12-21 05:39:23 |
| Message-ID: | 61121.1766295563@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Igor Korot <ikorot01(at)gmail(dot)com> writes:
> I added the following code in my app:
> res = PQexec( m_db, "SHOW client_encoding" );
> auto value = PQgetvalue( res, 0, 0 );
> PQclear( res );
> and the value of the "value" variable is "UTF8".
Okay ...
> The exact error message is:
> ERROR: invalid byte sequence for encoding UTF8: 0xdf
> CONTEXT: unnamed portal parameter $1
> on the INSERT.
client_encoding governs both the encoding that the server will
send, and the encoding that it expects to receive. You are
sending a parameter string that is not valid UTF8.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David G. Johnston | 2025-12-21 05:47:51 | Re: PQexecPrepared() question |
| Previous Message | Igor Korot | 2025-12-21 05:33:23 | Re: PQexecPrepared() question |