PHP + PostgreSQL: invalid byte sequence for encoding "UTF8"
| From: | aldnin | Date: | Sat, 21 Jul 2007 11:53:44 +0000 |
| Subject: | PHP + PostgreSQL: invalid byte sequence for encoding "UTF8" | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-43826@lists.php.net to get a copy of this message | ||
When I try to send this query (select 'lacarrière' as test;) to a UTF8 initialized
pgsql-database (8.2.4) from PHP 5.2.3 I get this error:
ERROR: invalid byte sequence for encoding "UTF8": 0xe87265
I use pg_query for the query delivery.
Client Encoding is set to:
client_encoding
-----------------
UTF8
(1 row)
pg_client_encoding() also deliveres me "UTF8".
Wel, one thing is strange, I think that the database itself can mange the obove string without any
problems - when I use the PostgreSQL Manager from EMS to insert that string into database I get the
correct result, and no errors.
Using php or even psql on the command line I get the errors. I think the way how to send UTF8 stuff
to the database has to be different as just pasting some text to psql or sending it through pg_query
like I did.
Does somebody has any idea how to fix this?