Re: PQexecPrepared() question
Peter J. Holzer <hjp-pgsql@hjp.at>
From: "Peter J. Holzer" <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Date: 2025-12-21T10:10:58Z
Lists: pgsql-general
On 2025-12-18 18:10:45 -0600, Igor Korot wrote:
> std::wcstombs( params[1], table.c_str(), table.length() );
I assume that the C++ function std::wcstombs() is just a wrapper around
the C function wcstombs(). According the the C standard:
| The behavior of the multibyte character functions is affected by the
| LC_CTYPE category of the current locale.
So you need to know what your current locale is. You can find out
(somewhat unintuitively) by calling setlocale().
> Invalid byte sequence for parameter $1 in UTF8
So your locale is probably not using UTF8.
hjp
--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"