int pg_set_client_encoding ([ resource $connection ], string $encoding )
pg_set_client_encoding() sets the client encoding and returns 0 if success or -1 if error. PostgreSQL will automatically convert data in the backend database encoding into the frontend encoding. Note: The function used to be called pg_setclientencoding().
Returns 0 on success or -1 on error.