diff --git a/includes/unicode.inc b/includes/unicode.inc
index 81a0a4d..74b27f1 100644
--- a/includes/unicode.inc
+++ b/includes/unicode.inc
@@ -503,8 +503,9 @@ function drupal_ucfirst($text) {
 }
 
 /**
- * Cut off a piece of a string based on character indices and counts. Follows
- * the same behavior as PHP's own substr() function.
+ * Cut off a piece of a string based on character indices and counts.
+ *
+ * Follows the same behavior as PHP's own substr() function.
  *
  * Note that for cutting off a string at a known character/substring
  * location, the usage of PHP's normal strpos/substr is safe and
@@ -516,6 +517,15 @@ function drupal_substr($text, $start, $length = NULL) {
   global $multibyte;
   if ($multibyte == UNICODE_MULTIBYTE) {
     return $length === NULL ? mb_substr($text, $start) : mb_substr($text, $start, $length);
+    // Note: When mb_substr fails it returns an empty string, when substr
+    // fails it returns FALSE. This checks we return what substr does.
+    if ($text === FALSE || is_null($text)) {
+      // This indicates a failure in the process.
+      return FALSE;
+    }
+    else {
+      return $length === NULL ? mb_substr($text, $start) : mb_substr($text, $start, $length);
+    }
   }
   else {
     $strlen = strlen($text);
diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module
index d831548..f000da1 100644
--- a/modules/dblog/dblog.module
+++ b/modules/dblog/dblog.module
@@ -136,19 +136,26 @@ function _dblog_get_message_types() {
  * Implements hook_watchdog().
  *
  * Note some values may be truncated for database column size restrictions.
+ * This function is UTF-8 safe.
  */
 function dblog_watchdog(array $log_entry) {
+  // Load Unicode support only once.
+  if (!function_exists('drupal_substr')) {
+    // Requires Unicode module to ensure strings are handled properly.
+    require_once DRUPAL_ROOT . '/includes/unicode.inc';
+  }
+
   Database::getConnection('default', 'default')->insert('watchdog')
     ->fields(array(
       'uid' => $log_entry['uid'],
-      'type' => substr($log_entry['type'], 0, 64),
+      'type' => drupal_substr($log_entry['type'], 0, 64),
       'message' => $log_entry['message'],
       'variables' => serialize($log_entry['variables']),
       'severity' => $log_entry['severity'],
-      'link' => substr($log_entry['link'], 0, 255),
+      'link' => drupal_substr($log_entry['link'], 0, 255),
       'location' => $log_entry['request_uri'],
       'referer' => $log_entry['referer'],
-      'hostname' => substr($log_entry['ip'], 0, 128),
+      'hostname' => drupal_substr($log_entry['ip'], 0, 128),
       'timestamp' => $log_entry['timestamp'],
     ))
     ->execute();
