diff -urNp roundcubemail-0.1.1.org/program/include/main.inc roundcubemail-0.1.1/program/include/main.inc
--- roundcubemail-0.1.1.org/program/include/main.inc	2008-04-05 21:49:21.000000000 +0900
+++ roundcubemail-0.1.1/program/include/main.inc	2008-10-01 15:13:13.000000000 +0900
@@ -943,7 +943,7 @@ function rcmail_message_cache_gc()
  */
 function rcube_charset_convert($str, $from, $to=NULL)
   {
-  global $MBSTRING;
+  global $MBSTRING, $CONFIG;
   static $convert_warning = false;
 
   $from = strtoupper($from);
@@ -955,8 +955,8 @@ function rcube_charset_convert($str, $fr
     
   $aliases = array(
     'UNKNOWN-8BIT'   => 'ISO-8859-15',
-    'X-UNKNOWN'      => 'ISO-8859-15',
-    'X-USER-DEFINED' => 'ISO-8859-15',
+    'X-UNKNOWN'      => $CONFIG['default_charset'],
+    'X-USER-DEFINED' => $CONFIG['default_charset'],
     'ISO-8859-8-I'   => 'ISO-8859-8',
     'KS_C_5601-1987' => 'EUC-KR',
   );
diff -urNp roundcubemail-0.1.1.org/program/include/rcube_imap.inc roundcubemail-0.1.1/program/include/rcube_imap.inc
--- roundcubemail-0.1.1.org/program/include/rcube_imap.inc	2008-10-01 15:07:59.000000000 +0900
+++ roundcubemail-0.1.1/program/include/rcube_imap.inc	2008-10-01 15:13:13.000000000 +0900
@@ -1016,6 +1016,7 @@ class rcube_imap
    */
   function &get_structure($uid)
     {
+    global $CONFIG;
     $cache_key = $this->mailbox.'.msg';
     $headers = &$this->get_cached_message($cache_key, $uid, true);
 
@@ -1028,6 +1029,10 @@ class rcube_imap
       return FALSE;
 
     $structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $msg_id); 
+    if ( preg_match ('/US-ASCII/', $structure_str) ) {
+      if ( $CONFIG['default_charset'] )
+        $structure_str = preg_replace ('/US-ASCII/', $CONFIG['default_charset'], $structure_str);
+    }
     $structure = iml_GetRawStructureArray($structure_str);
     $struct = false;
 
@@ -1066,6 +1071,9 @@ class rcube_imap
     {
     $struct = new rcube_message_part;
     $struct->mime_id = empty($parent) ? (string)$count : "$parent.$count";
+
+    if ( $GLOBALS['CONFIG']['default_charset'] )
+      $this->set_charset ($GLOBALS['CONFIG']['default_charset']);
     
     // multipart
     if (is_array($part[0]))
@@ -1218,6 +1226,9 @@ class rcube_imap
     {
     if (!($msg_id = $this->_uid2id($uid)))
       return FALSE;
+
+    if ( $GLOBALS['CONFIG']['default_charset'] )
+      $this->set_charset ($GLOBALS['CONFIG']['default_charset']);
     
     // get part encoding if not provided
     if (!is_object($o_part))
@@ -2316,6 +2327,9 @@ class rcube_imap
    */
   function decode_header($input, $remove_quotes=FALSE)
     {
+    if ( $GLOBALS['CONFIG']['default_charset'] )
+      $this->set_charset ($GLOBALS['CONFIG']['default_charset']);
+
     $str = rcube_imap::decode_mime_string((string)$input, $this->default_charset);
     if ($str{0}=='"' && $remove_quotes)
       $str = str_replace('"', '', $str);
@@ -2359,7 +2373,7 @@ class rcube_imap
       }
       
     // no encoding information, use fallback
-    return rcube_charset_convert($input, !empty($fallback) ? $fallback : 'ISO-8859-1');
+    return rcube_charset_convert($input, !empty($fallback) ? $fallback : $GLOBALS['CONFIG']['default_charset']);
     }
 
 
@@ -2436,6 +2450,9 @@ class rcube_imap
     if (is_array($ctype_param) && !empty($ctype_param['charset']))
       return rcube_charset_convert($body, $ctype_param['charset']);
 
+    if ( $GLOBALS['CONFIG']['default_charset'] )
+      $this->set_charset ($GLOBALS['CONFIG']['default_charset']);
+
     // defaults to what is specified in the class header
     return rcube_charset_convert($body,  $this->default_charset);
     }
diff -urNp roundcubemail-0.1.1.org/program/steps/mail/func.inc roundcubemail-0.1.1/program/steps/mail/func.inc
--- roundcubemail-0.1.1.org/program/steps/mail/func.inc	2008-04-05 21:49:21.000000000 +0900
+++ roundcubemail-0.1.1/program/steps/mail/func.inc	2008-10-01 15:13:13.000000000 +0900
@@ -1018,7 +1018,8 @@ function rcmail_message_body($attrib)
       else if ($part->type=='content')
         {
         if (empty($part->ctype_parameters) || empty($part->ctype_parameters['charset']))
-          $part->ctype_parameters['charset'] = $MESSAGE['headers']->charset;
+          $part->ctype_parameters['charset'] = $MESSAGE['headers']->charset ? 
+                                               $MESSAGE['headers']->charset : $CONFIG['default_charset'];
 
         // fetch part if not available
         if (!isset($part->body))
diff -urNp roundcubemail-0.1.1.org/program/steps/mail/show.inc roundcubemail-0.1.1/program/steps/mail/show.inc
--- roundcubemail-0.1.1.org/program/steps/mail/show.inc	2008-04-05 21:49:21.000000000 +0900
+++ roundcubemail-0.1.1/program/steps/mail/show.inc	2008-10-01 15:13:13.000000000 +0900
@@ -31,8 +31,9 @@ if ($_GET['_uid'])
   $MESSAGE['headers'] = $IMAP->get_headers($MESSAGE['UID']);
   
   // set message charset as default
-  if (!empty($MESSAGE['headers']->charset))
-    $IMAP->set_charset($MESSAGE['headers']->charset);
+  if (empty($MESSAGE['headers']->charset))
+    $MESSAGE['headers']->charset = $CONFIG['default_charset'];
+  $IMAP->set_charset($MESSAGE['headers']->charset);
   
   // go back to list if message not found (wrong UID)
   if (!$MESSAGE['headers'])
