aboutsummaryrefslogtreecommitdiffstats
path: root/include/common.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-10-09 01:43:29 +0000
committerrvelices <rv-github@modusoptimus.com>2007-10-09 01:43:29 +0000
commite9becfa669f9d7e64440992daeaf937388d26686 (patch)
treed5c8144c4c7ece7d71b2d9281b7c9f3c5cac2772 /include/common.inc.php
parent98b07a4a7fa1baff52800f70066f311768904430 (diff)
- PWG_CHARSET, DB_CHARSET and DB_COLLATE... utf-8 ready
git-svn-id: http://piwigo.org/svn/trunk@2127 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/common.inc.php')
-rw-r--r--include/common.inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/common.inc.php b/include/common.inc.php
index 18053e3ae..50c0d73fa 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -144,6 +144,23 @@ or die ( "Could not connect to database server" );
mysql_select_db( $cfgBase )
or die ( "Could not connect to database" );
+defined('PWG_CHARSET') and defined('DB_CHARSET')
+ or die('PWG_CHARSET and/or DB_CHARSET is not defined');
+if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') )
+{
+ if (DB_CHARSET!='')
+ {
+ pwg_query('SET NAMES "'.DB_CHARSET.'"');
+ }
+}
+else
+{
+ if ( strtolower(PWG_CHARSET)!='iso-8859-1' )
+ {
+ die('PWG supports only iso-8859-1 charset on MySql version '.mysql_get_server_info());
+ }
+}
+
//
// Setup gallery wide options, if this fails then we output a CRITICAL_ERROR
// since basic gallery information is not available