summaryrefslogtreecommitdiff
path: root/ext/pgsql/pgsql.c
diff options
context:
space:
mode:
authorJouni Ahto <jah@php.net>2000-07-29 04:24:11 +0000
committerJouni Ahto <jah@php.net>2000-07-29 04:24:11 +0000
commitd88fe953ae572e78356421bdd705126eef8a865a (patch)
treeb1fc842e3c0bea7ef931be220d76672453495cc4 /ext/pgsql/pgsql.c
parent90c1689cf09ea2234e89fc40a760b938044dafc7 (diff)
downloadphp-git-d88fe953ae572e78356421bdd705126eef8a865a.tar.gz
This should fix #5826.
Diffstat (limited to 'ext/pgsql/pgsql.c')
-rw-r--r--ext/pgsql/pgsql.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index c234715707..fa009ec469 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1665,6 +1665,12 @@ PHP_FUNCTION(pg_clientencoding)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+ /* Just do the same as found in PostgreSQL sources... */
+
+#ifndef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT
+#define pg_encoding_to_char(x) "SQL_ASCII"
+#endif
+
return_value->value.str.val
= (char *) pg_encoding_to_char(PQclientEncoding(pgsql));
return_value->value.str.len = strlen(return_value->value.str.val);