diff -ur phpBB2.orig/db/postgres7.php phpBB2/db/postgres7.php
--- phpBB2.orig/db/postgres7.php	2006-06-09 16:29:41.000000000 +0200
+++ phpBB2/db/postgres7.php	2006-07-03 14:38:42.000000000 +0200
@@ -78,6 +78,12 @@
 
 		$this->db_connect_id = ( $this->persistency ) ? pg_pconnect($this->connect_string) : pg_connect($this->connect_string);
 
+		# Use the same encoding for our connection to the DB as we do
+		# for talking with clients.  That allows us to pass in user
+		# input containing non-ascii chars into the database properly.
+		$encoding = ini_get ( 'default_charset' );
+		pg_set_client_encoding ( $this->db_connect_id, $encoding );
+
 		return ( $this->db_connect_id ) ? $this->db_connect_id : false;
 	}
 
