Masato Higashiyama japanese patch.
[squirrelmail.git] / src / view_text.php
index a333a1eb843dc3d61d0fa1e3ea4f1c88242a563f..54ddf14217f278a8ecb0bd2983ce4e4af37e2e2f 100644 (file)
@@ -32,7 +32,7 @@ sqgetGlobalVar('messages', $messages);
 sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
 
 if ( sqgetGlobalVar('mailbox', $temp, SQ_GET) ) {
-  $mailbox = urldecode($temp);
+  $mailbox = $temp;
 }
 if ( !sqgetGlobalVar('ent_id', $ent_id, SQ_GET) ) {
   $ent_id = '';
@@ -79,6 +79,14 @@ echo '</b></td><tr><tr><td><CENTER><A HREF="'.$dwnld_url. '">'.
      "</TD></TR></TABLE>".
      "<TABLE WIDTH=\"98%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
      "<TR><TD BGCOLOR=\"$color[4]\"><TT>";
+
+    if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
+        function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
+        if (mb_detect_encoding($body) != 'ASCII') {
+            $body = $languages[$squirrelmail_language]['XTRA_CODE']('decode', $body);
+        }
+    }
+
 if ($type1 == 'html' || (isset($override_type1) &&  $override_type1 == 'html')) {
     $body = MagicHTML( $body, $passed_id, $message, $mailbox);
 } else {