diff --git a/bootstrap.php b/bootstrap.php
index cc9437d7cf9be3760aae4ba411316216cc4a8adc..b303616ff224faee61b25493bf193011e3e96d9f 100644
--- a/bootstrap.php
+++ b/bootstrap.php
@@ -203,15 +203,49 @@ class Bootstrap {
                 function mb_strlen($str) { return strlen($str); }
                 function mb_substr($a, $b, $c=null) { return substr($a, $b, $c); }
                 function mb_convert_encoding($str, $to, $from='utf-8') {
-                    return iconv($from, $to, $str); }
+                    if (strcasecmp($to, $from) == 0)
+                        return $str;
+                    elseif (in_array(strtolower($to), array(
+                            'us-ascii','latin-1','iso-8859-1'))
+                            && function_exists('utf8_encode'))
+                        return utf8_encode($str);
+                    else
+                        return $str;
+                }
+            }
+            define('LATIN1_UC_CHARS', 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ');
+            define('LATIN1_LC_CHARS', 'àáâãäåæçèéêëìíîïðñòóôõöøùúûüý');
+            function mb_strtoupper($a) {
+                return strtoupper(strtr($str, LATIN1_LC_CHARS, LATIN1_UC_CHARS));
+            }
+            function mb_strtolower($a) {
+                return strtolower(strtr($str, LATIN1_UC_CHARS, LATIN1_LC_CHARS));
+            }
+            define('MB_CASE_LOWER', 1);
+            define('MB_CASE_UPPER', 2);
+            define('MB_CASE_TITLE', 3);
+            function mb_convert_case($str, $mode) {
+                // XXX: Techincally the calls to strto...() will fail if the
+                //      char is not a single-byte char
+                switch ($mode) {
+                case MB_CASE_LOWER:
+                    return preg_replace_callback('/\p{Lu}+/u',
+                        function($a) { return mb_strtolower($a); }, $str);
+                case MB_CASE_UPPER:
+                    return preg_replace_callback('/\p{Ll}+/u',
+                        function($a) { return mb_strtoupper($a); }, $str);
+                case MB_CASE_TITLE:
+                    return preg_replace_callback('/\b\p{Ll}/u',
+                        function($a) { return mb_strtoupper($a); }, $str);
+                }
             }
-            function mb_strtoupper($a) { return strtoupper($a); }
-            function mb_strtolower($a) { return strtolower($a); }
         }
         else {
             // Use UTF-8 for all multi-byte string encoding
             mb_internal_encoding('utf-8');
         }
+        if (extension_loaded('iconv'))
+            iconv_set_encoding('internal_encoding', 'UTF-8');
     }
 
     function croak($message) {
diff --git a/include/class.user.php b/include/class.user.php
index b1aae2e7c993cb56e217444555ff0da26ee5c7dd..c89543f2bee68326a3de4368c1a56631716b5876 100644
--- a/include/class.user.php
+++ b/include/class.user.php
@@ -159,6 +159,17 @@ class User extends UserModel {
                 $this->name = $parts[1].' '.$parts[0].' '.$parts[2];
                 break;
         }
+
+        // Handle email addresses -- use the box name
+        if (Validator::is_email($this->name)) {
+            list($box, $domain) = explode('@', $this->name, 2);
+            if (strpos($box, '.') !== false)
+                $this->name = str_replace('.', ' ', $box);
+            else
+                $this->name = $box;
+            $this->name = mb_convert_case($this->name, MB_CASE_TITLE);
+        }
+
         if (count($this->dirty))
             $this->set('updated', new SqlFunction('NOW'));
         return parent::save($refetch);