Index: serendipity_config.inc.php
===================================================================
--- serendipity_config.inc.php	(revision 1242)
+++ serendipity_config.inc.php	(working copy)
@@ -274,6 +274,15 @@
 }
 
 /*
+ * Reload configuration if we use SET NAMES in SQL connection
+ * to get proper encoding for configuration values
+ */
+if (defined('SQL_CHARSET') && $serendipity['dbNames']) {
+        serendipity_db_reconnect();
+        serendipity_reload_configuration();
+}
+
+/*
  *   Fallback charset, if none is defined in the language files
  */
 @define('LANG_CHARSET', 'ISO-8859-1');
Index: include/functions_config.inc.php
===================================================================
--- include/functions_config.inc.php	(revision 1242)
+++ include/functions_config.inc.php	(working copy)
@@ -290,6 +290,25 @@
         return true;
     }
 
+    serendipity_reload_configuration($author);
+
+    $config_loaded[$author] = true;
+}
+
+/**
+ * (Re-)Loads all configuration values and imports them to the $serendipity array
+ *
+ * Used internally from serendipity_load_configuration and in
+ * serendipity_config.inc.php after a SQL SET NAMES is requested
+ *
+ * @access public
+ * @param   int     The Authorid to fetch the configuration from (0: global)
+ * @return  null
+ */
+function serendipity_reload_configuration($author = null) {
+    global $serendipity;
+
+
     if (!empty($author)) {
         // Replace default configuration directives with user-relevant data
         $rows = serendipity_db_query("SELECT name,value
@@ -308,7 +327,6 @@
             $serendipity[$row['name']] = serendipity_get_bool($row['value']);
         }
     }
-    $config_loaded[$author] = true;
 }
 
 /**
