summaryrefslogtreecommitdiff
path: root/includes/database.pgsql.inc
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-01-21 01:42:52 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-01-21 01:42:52 +0000
commit7914ad0f3f9b29d78e7321ad9addbff99de48a4f (patch)
treebb97f37f191c966993a9607daa9f4168591dd68c /includes/database.pgsql.inc
parent0ff0c4beaaf0ae49e8b9b7afeda83a26d8d59666 (diff)
downloadbrdo-7914ad0f3f9b29d78e7321ad9addbff99de48a4f.tar.gz
brdo-7914ad0f3f9b29d78e7321ad9addbff99de48a4f.tar.bz2
- #40515: Ensure UTF-8 character set on the database side (and include upgrade path for incorrectly set up databases)
Diffstat (limited to 'includes/database.pgsql.inc')
-rw-r--r--includes/database.pgsql.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc
index 89e6b9d7b..8375c6366 100644
--- a/includes/database.pgsql.inc
+++ b/includes/database.pgsql.inc
@@ -335,6 +335,16 @@ function db_unlock_tables() {
}
/**
+ * Verify if the database is set up correctly.
+ */
+function db_check_setup() {
+ $encoding = db_result(db_query('SHOW server_encoding'));
+ if (!in_array(strtolower($encoding), array('unicode', 'utf8'))) {
+ drupal_set_message(t('Your PostgreSQL database is set up with the wrong character encoding (%encoding). It is possibile it will not work as expected. It is advised to recreate it with UTF-8/Unicode encoding. More information can be found in the <a href="%url">PostgreSQL documentation</a>.', array('%encoding' => $encoding, '%url' => 'http://www.postgresql.org/docs/7.4/interactive/multibyte.html')), 'status');
+ }
+}
+
+/**
* @} End of "ingroup database".
*/