Re: PHP + PostgreSQL: invalid byte sequence for encoding "UTF8"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Jul 21, 2007, at 7:53 AM, aldnin wrote:

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".


My guess is that your PHP is not setup to handle UTF8, and is really sending something else. UTF8 is the default client encoding because that is the encoding of the database. It does not mean that PHP has set the right one. Before running your test, try executing this: "SET client_encoding TO LATIN1;" and see if that fixes it.




John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux