Browse Source

Replacing tabs with spaces, trimming white space at EOL and newline at EOF

Fredrik Jervfors 20 years ago
parent
commit
8c8ecffa57
100 changed files with 2418 additions and 2418 deletions
  1. 7 7
      class/deliver/Deliver.class.php
  2. 3 3
      class/deliver/Deliver_IMAP.class.php
  3. 35 35
      class/deliver/Deliver_SMTP.class.php
  4. 28 28
      class/deliver/Deliver_SendMail.class.php
  5. 1 1
      class/deliver/index.php
  6. 35 35
      class/html.class.php
  7. 1 1
      class/index.php
  8. 1 1
      class/l10n.class.php
  9. 9 9
      class/l10n/gettext.class.php
  10. 2 2
      class/mime/AddressStructure.class.php
  11. 1 1
      class/mime/Language.class.php
  12. 12 12
      class/mime/Message.class.php
  13. 1 1
      class/mime/MessageHeader.class.php
  14. 1 1
      class/mime/index.php
  15. 34 34
      config/config_default.php
  16. 2 2
      config/config_local.php
  17. 1 1
      config/index.php
  18. 1 1
      contrib/RPM/config.php.redhat
  19. 1 1
      data/index.php
  20. 3 3
      functions/abook_database.php
  21. 2 2
      functions/abook_local_file.php
  22. 3 3
      functions/addressbook.php
  23. 7 7
      functions/auth.php
  24. 4 4
      functions/date.php
  25. 130 130
      functions/decode/cp1250.php
  26. 130 130
      functions/decode/cp1251.php
  27. 130 130
      functions/decode/cp1252.php
  28. 130 130
      functions/decode/cp1253.php
  29. 130 130
      functions/decode/cp1254.php
  30. 130 130
      functions/decode/cp1255.php
  31. 130 130
      functions/decode/cp1256.php
  32. 118 118
      functions/decode/cp1257.php
  33. 130 130
      functions/decode/cp1258.php
  34. 131 131
      functions/decode/cp855.php
  35. 131 131
      functions/decode/cp866.php
  36. 1 1
      functions/decode/iso_8859_10.php
  37. 110 110
      functions/decode/iso_8859_11.php
  38. 1 1
      functions/decode/iso_8859_13.php
  39. 2 2
      functions/decode/iso_8859_14.php
  40. 1 1
      functions/decode/iso_8859_15.php
  41. 1 1
      functions/decode/iso_8859_16.php
  42. 1 1
      functions/decode/iso_8859_2.php
  43. 1 1
      functions/decode/iso_8859_3.php
  44. 1 1
      functions/decode/iso_8859_4.php
  45. 1 1
      functions/decode/iso_8859_5.php
  46. 1 1
      functions/decode/iso_8859_6.php
  47. 1 1
      functions/decode/iso_8859_7.php
  48. 1 1
      functions/decode/iso_8859_8.php
  49. 1 1
      functions/decode/iso_8859_9.php
  50. 6 6
      functions/decode/iso_ir_111.php
  51. 1 1
      functions/decode/koi8_r.php
  52. 1 1
      functions/decode/koi8_u.php
  53. 2 2
      functions/decode/ns_4551_1.php
  54. 2 2
      functions/decode/tis_620.php
  55. 1 1
      functions/decode/utf_8.php
  56. 1 1
      functions/display_messages.php
  57. 5 5
      functions/encode/cp1251.php
  58. 5 5
      functions/encode/cp1255.php
  59. 5 5
      functions/encode/cp1256.php
  60. 5 5
      functions/encode/iso_8859_1.php
  61. 5 5
      functions/encode/iso_8859_15.php
  62. 5 5
      functions/encode/iso_8859_2.php
  63. 5 5
      functions/encode/iso_8859_7.php
  64. 5 5
      functions/encode/iso_8859_9.php
  65. 5 5
      functions/encode/koi8_r.php
  66. 5 5
      functions/encode/koi8_u.php
  67. 5 5
      functions/encode/tis_620.php
  68. 4 4
      functions/encode/us_ascii.php
  69. 6 6
      functions/encode/utf_8.php
  70. 4 4
      functions/html.php
  71. 1 1
      functions/htmlentities/index.php
  72. 97 97
      functions/htmlentities/iso-8859-1.php
  73. 2 2
      functions/htmlentities/readme.php
  74. 262 262
      functions/htmlentities/utf-8.php
  75. 4 4
      functions/i18n.php
  76. 19 19
      functions/imap_asearch.php
  77. 6 6
      functions/imap_general.php
  78. 2 2
      functions/imap_mailbox.php
  79. 1 1
      functions/imap_search.php
  80. 160 160
      functions/imap_utf7_local.php
  81. 2 2
      functions/mailbox_display.php
  82. 2 2
      functions/page_header.php
  83. 1 1
      functions/plugin.php
  84. 4 4
      functions/strings.php
  85. 7 7
      functions/url_parser.php
  86. 1 1
      help/index.php
  87. 1 1
      images/index.php
  88. 1 1
      images/themes/default/index.php
  89. 1 1
      images/themes/default/theme.php
  90. 1 1
      images/themes/index.php
  91. 1 1
      images/themes/none/index.php
  92. 1 1
      images/themes/none/theme.php
  93. 1 1
      images/themes/xp/index.php
  94. 1 1
      images/themes/xp/theme.php
  95. 1 1
      include/index.php
  96. 1 1
      include/options/display.php
  97. 1 1
      include/options/index.php
  98. 2 2
      include/options/personal.php
  99. 11 11
      include/validate.php
  100. 1 1
      index.php

+ 7 - 7
class/deliver/Deliver.class.php

@@ -465,14 +465,14 @@ class Deliver {
             switch($rfc822_header->priority)
             {
             case 1:
-	    	$header[] = 'X-Priority: 1 (Highest)'.$rn;
-	    	$header[] = 'Importance: High'. $rn; break;
+                $header[] = 'X-Priority: 1 (Highest)'.$rn;
+                $header[] = 'Importance: High'. $rn; break;
             case 3:
-	    	$header[] = 'X-Priority: 3 (Normal)'.$rn;
-	    	$header[] = 'Importance: Normal'. $rn; break;
+                $header[] = 'X-Priority: 3 (Normal)'.$rn;
+                $header[] = 'Importance: Normal'. $rn; break;
             case 5:
-	    	$header[] = 'X-Priority: 5 (Lowest)'.$rn;
-	    	$header[] = 'Importance: Low'. $rn; break;
+                $header[] = 'X-Priority: 5 (Lowest)'.$rn;
+                $header[] = 'Importance: Low'. $rn; break;
             default: break;
             }
         }
@@ -686,4 +686,4 @@ class Deliver {
         return $refer;
     }
 }
-?>
+?>

+ 3 - 3
class/deliver/Deliver_IMAP.class.php

@@ -24,10 +24,10 @@ class Deliver_IMAP extends Deliver {
     function getBcc() {
        return true;
     }
-    
-    /* to do: finishing the imap-class so the initStream function can call the 
+
+    /* to do: finishing the imap-class so the initStream function can call the
        imap-class */
 }
 
 
-?>
+?>

+ 35 - 35
class/deliver/Deliver_SMTP.class.php

@@ -26,16 +26,16 @@ class Deliver_SMTP extends Deliver {
             $s = str_replace("\n.","\n..",$s);
         }
     }
-    
+
     function initStream($message, $domain, $length=0, $host='', $port='', $user='', $pass='', $authpop=false) {
         global $use_smtp_tls,$smtp_auth_mech;
-    
+
         if ($authpop) {
             $this->authPop($host, '', $user, $pass);
         }
-    
+
         $rfc822_header = $message->rfc822_header;
-        
+
         $from = $rfc822_header->from[0];
         $to =   $rfc822_header->to;
         $cc =   $rfc822_header->cc;
@@ -43,20 +43,20 @@ class Deliver_SMTP extends Deliver {
         $content_type  = $rfc822_header->content_type;
 
         // MAIL FROM: <from address> MUST be empty in cae of MDN (RFC2298)
-        if ($content_type->type0 == 'multipart' && 
+        if ($content_type->type0 == 'multipart' &&
             $content_type->type1 == 'report' &&
             isset($content_type->properties['report-type']) &&
             $content_type->properties['report-type']=='disposition-notification') {
             $from->host = '';
             $from->mailbox = '';
-        } 
-            
+        }
+
         if (($use_smtp_tls == true) and (check_php_version(4,3)) and (extension_loaded('openssl'))) {
             $stream = fsockopen('tls://' . $host, $port, $errorNumber, $errorString);
         } else {
             $stream = fsockopen($host, $port, $errorNumber, $errorString);
         }
-    
+
         if (!$stream) {
             $this->dlv_msg = $errorString;
             $this->dlv_ret_nr = $errorNumber;
@@ -66,10 +66,10 @@ class Deliver_SMTP extends Deliver {
         if ($this->errorCheck($tmp, $stream)) {
             return(0);
         }
-    
-        /* 
+
+        /*
         * If $_SERVER['HTTP_HOST'] is set, use that in our HELO to the SMTP
-        * server.  This should fix the DNS issues some people have had 
+        * server.  This should fix the DNS issues some people have had
         */
         if (sqgetGlobalVar('HTTP_HOST', $HTTP_HOST, SQ_SERVER)) { // HTTP_HOST is set
             // optionally trim off port number
@@ -80,7 +80,7 @@ class Deliver_SMTP extends Deliver {
         } else { // For some reason, HTTP_HOST is not set - revert to old behavior
             $helohost = $domain;
         }
-        
+
         /* Lets introduce ourselves */
         fputs($stream, "EHLO $helohost\r\n");
         $tmp = fgets($stream,1024);
@@ -96,7 +96,7 @@ class Deliver_SMTP extends Deliver {
                 return(0);
             }
         }
-    
+
         if (( $smtp_auth_mech == 'cram-md5') or ( $smtp_auth_mech == 'digest-md5' )) {
             // Doing some form of non-plain auth
             if ($smtp_auth_mech == 'cram-md5') {
@@ -104,35 +104,35 @@ class Deliver_SMTP extends Deliver {
             } elseif ($smtp_auth_mech == 'digest-md5') {
                 fputs($stream, "AUTH DIGEST-MD5\r\n");
             }
-        
+
             $tmp = fgets($stream,1024);
-            
+
             if ($this->errorCheck($tmp,$stream)) {
                 return(0);
             }
-            
+
             // At this point, $tmp should hold "334 <challenge string>"
             $chall = substr($tmp,4);
-            // Depending on mechanism, generate response string 
+            // Depending on mechanism, generate response string
             if ($smtp_auth_mech == 'cram-md5') {
                 $response = cram_md5_response($user,$pass,$chall);
             } elseif ($smtp_auth_mech == 'digest-md5') {
                 $response = digest_md5_response($user,$pass,$chall,'smtp',$host);
             }
             fputs($stream, $response);
-            
+
             // Let's see what the server had to say about that
             $tmp = fgets($stream,1024);
             if ($this->errorCheck($tmp,$stream)) {
                 return(0);
             }
-            
+
             // CRAM-MD5 is done at this point.  If DIGEST-MD5, there's a bit more to go
             if ($smtp_auth_mech == 'digest-md5') {
                 // $tmp contains rspauth, but I don't store that yet. (No need yet)
                 fputs($stream,"\r\n");
                 $tmp = fgets($stream,1024);
-                
+
                 if ($this->errorCheck($tmp,$stream)) {
                 return(0);
                 }
@@ -145,7 +145,7 @@ class Deliver_SMTP extends Deliver {
             // The LOGIN method
             fputs($stream, "AUTH LOGIN\r\n");
             $tmp = fgets($stream, 1024);
-        
+
             if ($this->errorCheck($tmp, $stream)) {
                 return(0);
             }
@@ -154,7 +154,7 @@ class Deliver_SMTP extends Deliver {
             if ($this->errorCheck($tmp, $stream)) {
                 return(0);
             }
-        
+
             fputs($stream, base64_encode($pass) . "\r\n");
             $tmp = fgets($stream, 1024);
             if ($this->errorCheck($tmp, $stream)) {
@@ -163,16 +163,16 @@ class Deliver_SMTP extends Deliver {
         } elseif ($smtp_auth_mech == "plain") {
             /* SASL Plain */
             $auth = base64_encode("$user\0$user\0$pass");
-                        
+
             $query = "AUTH PLAIN\r\n";
             fputs($stream, $query);
             $read=fgets($stream, 1024);
-        
+
             if (substr($read,0,3) == '334') { // OK so far..
                 fputs($stream, "$auth\r\n");
                 $read = fgets($stream, 1024);
             }
-                        
+
             $results=explode(" ",$read,3);
             $response=$results[1];
             $message=$results[2];
@@ -184,16 +184,16 @@ class Deliver_SMTP extends Deliver {
                 return(0);
             }
         }
-        
+
         /* Ok, who is sending the message? */
-        $fromaddress = ($from->mailbox && $from->host) ? 
+        $fromaddress = ($from->mailbox && $from->host) ?
             $from->mailbox.'@'.$from->host : '';
         fputs($stream, 'MAIL FROM:<'.$fromaddress.">\r\n");
         $tmp = fgets($stream, 1024);
         if ($this->errorCheck($tmp, $stream)) {
             return(0);
         }
-    
+
         /* send who the recipients are */
         for ($i = 0, $cnt = count($to); $i < $cnt; $i++) {
             if (!$to[$i]->host) $to[$i]->host = $domain;
@@ -205,8 +205,8 @@ class Deliver_SMTP extends Deliver {
                 }
             }
         }
-        
-        for ($i = 0, $cnt = count($cc); $i < $cnt; $i++) {	
+
+        for ($i = 0, $cnt = count($cc); $i < $cnt; $i++) {
             if (!$cc[$i]->host) $cc[$i]->host = $domain;
             if ($cc[$i]->mailbox) {
                 fputs($stream, 'RCPT TO:<'.$cc[$i]->mailbox.'@'.$cc[$i]->host.">\r\n");
@@ -216,7 +216,7 @@ class Deliver_SMTP extends Deliver {
                 }
             }
         }
-    
+
         for ($i = 0, $cnt = count($bcc); $i < $cnt; $i++) {
             if (!$bcc[$i]->host) $bcc[$i]->host = $domain;
             if ($bcc[$i]->mailbox) {
@@ -235,7 +235,7 @@ class Deliver_SMTP extends Deliver {
         }
         return $stream;
     }
-    
+
     function finalizeStream($stream) {
         fputs($stream, "\r\n.\r\n"); /* end the DATA part */
         $tmp = fgets($stream, 1024);
@@ -247,7 +247,7 @@ class Deliver_SMTP extends Deliver {
         fclose($stream);
         return true;
     }
-    
+
     /* check if an SMTP reply is an error and set an error message) */
     function errorCheck($line, $smtpConnection) {
 
@@ -286,7 +286,7 @@ class Deliver_SMTP extends Deliver {
         case '503': $message = _("Bad sequence of commands");
             break;
         case '504': $message = _("Command parameter not implemented");
-            break;    
+            break;
         case '530': $message = _("Authentication required");
             break;
         case '534': $message = _("Authentication mechanism is too weak");
@@ -314,7 +314,7 @@ class Deliver_SMTP extends Deliver {
 
         return true;
     }
-    
+
     function authPop($pop_server='', $pop_port='', $user, $pass) {
         if (!$pop_port) {
             $pop_port = 110;

+ 28 - 28
class/deliver/Deliver_SendMail.class.php

@@ -15,7 +15,7 @@
 
 /** This of course depends upon Deliver */
 require_once(SM_PATH . 'class/deliver/Deliver.class.php');
- 
+
 /**
  * Delivers messages using the sendmail binary
  * @package squirrelmail
@@ -27,15 +27,15 @@ class Deliver_SendMail extends Deliver {
     *
     * Sendmail needs LF's as line endings instead of CRLF.
     * This function translates the line endings to LF and should be called
-    * before each line is written to the stream. 
-    *  
+    * before each line is written to the stream.
+    *
     * @param string $s Line to process
     * @return void
     * @access private
-    */ 
+    */
     function preWriteToStream(&$s) {
        if ($s) {
-    	  $s = str_replace("\r\n", "\n", $s);
+           $s = str_replace("\r\n", "\n", $s);
        }
     }
 
@@ -43,63 +43,63 @@ class Deliver_SendMail extends Deliver {
     * function initStream
     *
     * Initialise the sendmail connection.
-    *  
+    *
     * @param Message $message Message object containing the from address
     * @param string $sendmail_path Location of sendmail binary
     * @return void
-    * @access public 
-    */    
+    * @access public
+    */
     function initStream($message, $sendmail_path) {
         $rfc822_header = $message->rfc822_header;
-	$from = $rfc822_header->from[0];
-	$envelopefrom = trim($from->mailbox.'@'.$from->host);
+        $from = $rfc822_header->from[0];
+        $envelopefrom = trim($from->mailbox.'@'.$from->host);
         $envelopefrom = str_replace(array("\0","\n"),array('',''),$envelopefrom);
-	if (strstr($sendmail_path, "qmail-inject")) {
-    	    $stream = popen (escapeshellcmd("$sendmail_path -f$envelopefrom"), "w");
-	} else {
-    	    $stream = popen (escapeshellcmd("$sendmail_path -i -t -f$envelopefrom"), "w");
-	}
-	return $stream;
+        if (strstr($sendmail_path, "qmail-inject")) {
+            $stream = popen (escapeshellcmd("$sendmail_path -f$envelopefrom"), "w");
+        } else {
+            $stream = popen (escapeshellcmd("$sendmail_path -i -t -f$envelopefrom"), "w");
+        }
+        return $stream;
     }
 
    /**
     * function finalizeStream
     *
     * Close the stream.
-    *  
+    *
     * @param resource $stream
     * @return boolean
     * @access public
-    */    
+    */
     function finalizeStream($stream) {
-	pclose($stream);
-	return true;
+        pclose($stream);
+        return true;
     }
 
    /**
     * function getBcc
     *
     * In case of sendmail, the rfc822header must contain the bcc header.
-    *  
+    *
     * @return boolean true if rfc822header should include the bcc header.
     * @access private
     */
     function getBcc() {
        return true;
     }
-    
+
    /**
     * function clean_crlf
     *
     * Cleans each line to only end in a LF
-    * Returns the length of the line including a CR, 
+    * Returns the length of the line including a CR,
     * so that length is correct when the message is saved to imap
-    * Implemented to fix sendmail->postfix rejection of messages with 
+    * Implemented to fix sendmail->postfix rejection of messages with
     * attachments because of stray LF's
     *
-    * @param string $s string to strip of CR's 
+    * @param string $s string to strip of CR's
     * @return integer length of string including a CR for each LF
-    * @access private 
+    * @access private
     */
     function clean_crlf(&$s) {
         $s = str_replace("\r\n", "\n", $s);
@@ -107,7 +107,7 @@ class Deliver_SendMail extends Deliver {
         $s2 = str_replace("\n", "\r\n", $s);
         return strlen($s2);
     }
-    
+
 
 }
-?>
+?>

+ 1 - 1
class/deliver/index.php

@@ -1,3 +1,3 @@
 <?php
 header('Location: ../index.php');
-?>
+?>

+ 35 - 35
class/html.class.php

@@ -16,7 +16,7 @@
  * @package squirrelmail
  */
 class html {
-  var $tag, $text, $style, $class,  
+  var $tag, $text, $style, $class,
       $id, $html_el = array(), $javascript, $xtr_prop;
 
   function html($tag='', $text='', $style ='', $class='', $id='',
@@ -29,59 +29,59 @@ class html {
      $this->xtr_prop = $xtr_prop;
      $this->javascript = $javascript;
   }
-  
+
   function htmlAdd($el, $last=true) {
      if ($last) {
         $this->html_el[] = $el;
      } else {
-	$new_html_el = array();
-	$new_html_el[] = $el;
-	foreach ($this->html_el as $html_el) {
-	   $new_html_el[] = $html_el;
-	}
-	$this->html_el = $new_html_el;
+         $new_html_el = array();
+         $new_html_el[] = $el;
+         foreach ($this->html_el as $html_el) {
+             $new_html_el[] = $html_el;
+         }
+         $this->html_el = $new_html_el;
      }
   }
-  
+
   function AddChild($tag='', $text='', $style ='', $class='', $id='',
                   $xtr_prop = '', $javascript = '') {
      $el = new html ($tag, $text, $style, $class, $id, $xtr_prop, $javascript);
      $this->htmlAdd($el);
   }
-  
+
   function FindId($id) {
      $cnt = count($this->html_el);
      $el = false;
      if ($cnt) {
         for ($i = 0 ; $i < $cnt; $i++) {
-	    if ($this->html_el[$i]->id == $id) {
-	       $ret = $this->html_el[$i];
-	       return $ret;
-	    } else if (count($this->html_el[$i]->html_el)) {
-	       $el = $this->html_el[$i]->FindId($id);
-	    }
-	    if ($el) return $el;
+            if ($this->html_el[$i]->id == $id) {
+                $ret = $this->html_el[$i];
+                return $ret;
+            } else if (count($this->html_el[$i]->html_el)) {
+                $el = $this->html_el[$i]->FindId($id);
+            }
+            if ($el) return $el;
         }
      }
      return $el;
-  }     
+  }
 
   function InsToId( $el, $id, $last=true) {
      $html_el = &$this->FindId($id);
      if ($html_el) {
         $html_el->htmlAdd($el, $last);
      }
-  }     
-  
+  }
+
   function scriptAdd($script) {
      $s = "\n".'<!--'."\n".
-	  $script .
-	  "\n".'// -->'."\n";
+         $script .
+         "\n".'// -->'."\n";
      $el = new html ('script',$s,'','','',array('language' => 'JavaScript',
                                                 'type' => 'text/javascript'));
      $this->htmlAdd($el);
   }
-  
+
   function echoHtml( $usecss=false, $indent='x') {
     if ($indent == 'x') {
       $indent = ''; $indentmore = '';
@@ -99,26 +99,26 @@ class html {
        $prop = '';
        foreach ($xtr_prop as $k => $v) {
           if (is_string($k)) {
-             $prop.=' '.$k.'="'.$v.'"';
-	  } else {
-	     $prop.=' '.$v;
-	  }
+              $prop.=' '.$k.'="'.$v.'"';
+          } else {
+              $prop.=' '.$v;
+          }
        }
-    }   
+    }
     if ($javascript) {
        $js = '';
        foreach ($javascript as $k => $v) { /* here we put the onclick, onmouseover etc entries */
           $js.=' '.$k.'="'.$v.'";';
        }
     }
-    if ($tag) {   	  
+    if ($tag) {
        echo $indent . '<' . $tag;
     } else {
        echo $indent;
     }
     if ($class) {
        echo ' class="'.$class.'"';
-    }  
+    }
     if ($id) {
        echo ' id="'.$id.'"';
     }
@@ -127,7 +127,7 @@ class html {
     }
     if ($style && !$usecss && !is_array($style)) {
        /* last premisse is to prevent 'style="Array"' in the output */
-       echo ' style="'.$style.'"';  
+       echo ' style="'.$style.'"';
     }
     if ($javascript) {
        echo ' '.$js;
@@ -142,9 +142,9 @@ class html {
        }
        foreach ($style as $k => $v) {
           /* if value of key value = true close the tag */
-	  if ($v) {
+          if ($v) {
              $closestyles .= '</'.$k.'>';
-          }   
+          }
        }
     }
     echo $openstyles;
@@ -158,7 +158,7 @@ class html {
        echo "\n";
        for($i = 0;$i<$cnt;$i++) {
           $el = $this->html_el[$i];
-	  $el->echoHtml($usecss,$indentmore);
+          $el->echoHtml($usecss,$indentmore);
        }
        echo $indent;
     }
@@ -170,6 +170,6 @@ class html {
     }
   }
 }
- 
+
 
 ?>

+ 1 - 1
class/index.php

@@ -18,4 +18,4 @@ header("Location:../index.php");
 
 /* pretty impressive huh? */
 
-?>
+?>

+ 1 - 1
class/l10n.class.php

@@ -5,7 +5,7 @@
  * Copyright (c) 2003-2004 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
- * This contains internal squirrelmail functions needed to handle 
+ * This contains internal squirrelmail functions needed to handle
  * translations when php gettext extension is missing or some functions
  * are not available.
  *

+ 9 - 9
class/l10n/gettext.class.php

@@ -21,7 +21,7 @@
  * @package squirrelmail
  * @subpackage i18n
  */
- 
+
 /**
  * Class that uses parsed translation input objects
  * @package squirrelmail
@@ -57,9 +57,9 @@ class gettext_reader {
             $byte[$i]=ord($this->STREAM->read(1));
         }
         //print sprintf("pos: %d\n",$this->STREAM->currentpos());
-        if ($this->BYTEORDER == 0) 
+        if ($this->BYTEORDER == 0)
             return (int)(($byte[0]) | ($byte[1]<<8) | ($byte[2]<<16) | ($byte[3]<<24));
-        else 
+        else
             return (int)(($byte[3]) | ($byte[2]<<8) | ($byte[1]<<16) | ($byte[0]<<24));
     }
 
@@ -161,7 +161,7 @@ class gettext_reader {
         $data = $this->STREAM->read($length);
         return (string)$data;
     }
-  
+
     /**
      * binary search for string
      * @param string $string
@@ -190,7 +190,7 @@ class gettext_reader {
             if ($cmp == 0) {
                 $this->_HASHED[$string] = $half;
                 return $half;
-            } elseif ($cmp<0) 
+            } elseif ($cmp<0)
                 return $this->find_string($string,$start,$half);
             else
                 return $this->find_string($string,$half,$end);
@@ -203,11 +203,11 @@ class gettext_reader {
      * @return string translated string
      */
     function translate($string) {
-	if ($this->error > 0) return $string;
+        if ($this->error > 0) return $string;
         $num = $this->find_string($string, 0, $this->total);
         if ($num == -1)
             return $string;
-        else 
+        else
             return $this->get_translation_number($num);
     }
 
@@ -220,7 +220,7 @@ class gettext_reader {
         // this is true, right?
 
         // cache header field for plural forms
-        if (isset($this->pluralheader) && is_string($this->pluralheader)) 
+        if (isset($this->pluralheader) && is_string($this->pluralheader))
             return $this->pluralheader;
         else {
             $header = $this->get_translation_number(0);
@@ -266,7 +266,7 @@ class gettext_reader {
             $result=-1;
         } else {
             // find out the appropriate form
-            $select = $this->select_string($number); 
+            $select = $this->select_string($number);
 
             // this should contains all strings separated by NULLs
             $result = $this->find_string($single.chr(0).$plural,0,$this->total);

+ 2 - 2
class/mime/AddressStructure.class.php

@@ -47,7 +47,7 @@ class AddressStructure {
                     }
                 }
                 $addr = ($email ? $personal . ' <' .$email.'>'
-                        : $this->personal);                                    
+                        : $this->personal);
                 $best_dpl = $this->personal;
             } else {
                 $addr = $email;
@@ -57,7 +57,7 @@ class AddressStructure {
         }
         return $result;
     }
-    
+
     function getEncodedAddress() {
         return $this->getAddress(true, true);
     }

+ 1 - 1
class/mime/Language.class.php

@@ -23,4 +23,4 @@ class Language {
     }
 }
 
-?>
+?>

+ 12 - 12
class/mime/Message.class.php

@@ -74,7 +74,7 @@ class Message {
             $cur_ent_a = explode('.', $this->entity_id);
         }
         $ent_a = explode('.', $ent);
-        
+
         for ($i = 0,$entCount = count($ent_a) - 1; $i < $entCount; ++$i) {
             if (isset($cur_ent_a[$i]) && ($cur_ent_a[$i] != $ent_a[$i])) {
                 $msg = $msg->parent;
@@ -145,12 +145,12 @@ class Message {
         if($msg) $msg->setEntIds($msg,false,0);
         return $msg;
     }
-    
+
     function setEntIds(&$msg,$init=false,$i=0) {
         $iCnt = count($msg->entities);
         if ($init !==false) {
             $iEntSub = $i+1;
-            if ($msg->parent->type0 == 'message' && 
+            if ($msg->parent->type0 == 'message' &&
                 $msg->parent->type1 == 'rfc822' &&
                 $msg->type0 == 'multipart') {
                 $iEntSub = '0';
@@ -166,8 +166,8 @@ class Message {
             $msg->entity_id='1';
         }
         for ($i=0;$i<$iCnt;++$i) {
-            $msg->entities[$i]->parent =& $msg;    
-            if (strrchr($msg->entity_id, '.') != '.0') {    
+            $msg->entities[$i]->parent =& $msg;
+            if (strrchr($msg->entity_id, '.') != '.0') {
                 $msg->entities[$i]->setEntIds($msg->entities[$i],$msg->entity_id,$i);
             } else {
                 $msg->entities[$i]->setEntIds($msg->entities[$i],$msg->parent->entity_id,$i);
@@ -183,7 +183,7 @@ class Message {
         } else {
             $message = new Message();
         }
-    
+
         for ($cnt = strlen($read); $i < $cnt; ++$i) {
             $char = strtoupper($read{$i});
             switch ($char) {
@@ -294,7 +294,7 @@ class Message {
                     $arg_a[] = $msg->parseLiteral($read, $i);
                     ++$arg_no;
                     break;
-        case '0':    
+        case '0':
                 case is_numeric($read{$i}):
                     /* process integers */
                     if ($read{$i} == ' ') { break; }
@@ -442,7 +442,7 @@ class Message {
         if (count($arg_a) > 9) {
             $d = strtr($arg_a[0], array('  ' => ' '));
             $d = explode(' ', $d);
-        if (!$arg_a[1]) $arg_a[1] = _("(no subject)");        
+        if (!$arg_a[1]) $arg_a[1] = _("(no subject)");
 
             $hdr->date = getTimeStamp($d); /* argument 1: date */
             $hdr->subject = $arg_a[1];     /* argument 2: subject */
@@ -691,7 +691,7 @@ class Message {
 //        $alt_order[] = "message/rfc822";
             foreach ($alt_order as $alt) {
                 if( ($alt == $type) && isset($this->entity_id) ) {
-                    if ((count($this->entities) == 0) && 
+                    if ((count($this->entities) == 0) &&
                 (!isset($ent->header->parameters['filename'])) &&
                 (!isset($ent->header->parameters['name'])) &&
                         (strtolower($this->header->disposition->name) != 'attachment')) {
@@ -765,7 +765,7 @@ class Message {
 
     function getAttachments($exclude_id=array(), $result = array()) {
 /*
-        if (($this->type0 == 'message') && 
+        if (($this->type0 == 'message') &&
         ($this->type1 == 'rfc822') &&
         ($this->entity_id) ) {
             $this = $this->entities[0];
@@ -801,7 +801,7 @@ class Message {
         }
         return $result;
     }
-    
+
     function initAttachment($type, $name, $location) {
         $attachment = new Message();
         $mime_header = new MessageHeader();
@@ -822,4 +822,4 @@ class Message {
     }
 }
 
-?>
+?>

+ 1 - 1
class/mime/MessageHeader.class.php

@@ -13,7 +13,7 @@
  */
 
 /**
- * Contains all variables available in a bodystructure 
+ * Contains all variables available in a bodystructure
  * @package squirrelmail
  */
 class MessageHeader {

+ 1 - 1
class/mime/index.php

@@ -1,3 +1,3 @@
 <?php
 header('Location: ../index.php');
-?>
+?>

+ 34 - 34
config/config_default.php

@@ -80,7 +80,7 @@ $frame_top = '_top';
  *
  * Here you can set name of the link displayed on the right side of main page.
  *
- * Link will be displayed only if you have $hide_sm_attributions 
+ * Link will be displayed only if you have $hide_sm_attributions
  * option set to true.
  * @global string $provider_name
  */
@@ -91,7 +91,7 @@ $provider_name = 'SquirrelMail';
  *
  * Here you can set URL of the link displayed on the right side of main page.
  *
- * Link will be displayed only if you have $hide_sm_attributions 
+ * Link will be displayed only if you have $hide_sm_attributions
  * option set to true.
  * @global string $provider_uri
  */
@@ -125,7 +125,7 @@ $invert_time = false;
  *
  * What should be used when sending email.
  * If it is set to false, SquirrelMail will use SMTP server settings.
- * If it is set to true, SquirrelMail will use program defined in 
+ * If it is set to true, SquirrelMail will use program defined in
  * $sendmail_path
  * @global bool $useSendmail
  */
@@ -149,8 +149,8 @@ $smtpPort = 25;
  * This can increase user's privacy and solve problems with spam filters
  * that increase spam marks for dynamic dialup addresses.
  *
- * If admin enables this setting, system should have some logging facility 
- * or other tools to control users. SquirrelMail's Received: header provides 
+ * If admin enables this setting, system should have some logging facility
+ * or other tools to control users. SquirrelMail's Received: header provides
  * information, that can't be forged by webmail user.
  * @global bool $skip_SM_header
  */
@@ -160,12 +160,12 @@ $skip_SM_header = false;
  * Path to Sendmail
  *
  * Program that should be used when sending email. SquirrelMail expects that
- * this program will follow options used by original sendmail 
+ * this program will follow options used by original sendmail
  * (http://www.sendmail.org).
  * @global string $sendmail_path
  */
 $sendmail_path = '/usr/sbin/sendmail';
-    
+
 /**
  * IMAP server address
  *
@@ -360,7 +360,7 @@ $auto_create_special = true;
  * List Special Folders First Control
  *
  * Whether or not to list the special folders first (true/false).
- * @global bool $list_special_folders_first 
+ * @global bool $list_special_folders_first
  */
 $list_special_folders_first = true;
 
@@ -382,7 +382,7 @@ $default_sub_of_inbox = true;
  * option during folder creation. The option toggles which type of
  * folder it should be.
  *
- * If this option confuses you, just set it to 'true'. You can not hurt 
+ * If this option confuses you, just set it to 'true'. You can not hurt
  * anything if it's true, but some servers will respond weird if it's
  * false. (Cyrus works fine whether it's true OR false).
  * @global bool $show_contain_subfolders_option
@@ -393,7 +393,7 @@ $show_contain_subfolders_option = false;
  * These next two options set the defaults for the way that the
  * users see their folder list.
  *   $default_unseen_notify
- *       Specifies whether or not the users will see the number of 
+ *       Specifies whether or not the users will see the number of
  *       unseen in each folder by default and also which folders to
  *       do this to. Valid values are: 1=none, 2=inbox, 3=all.
  *   $default_unseen_type
@@ -445,7 +445,7 @@ $data_dir = SM_PATH . 'data/';
  *      list files in this directory. Confidential data might be laying
  *      around there.
  *    + Since the webserver is not able to list the files in the content
- *       is also impossible for the webserver to delete files lying around 
+ *       is also impossible for the webserver to delete files lying around
  *       there for too long.
  *    + It should probably be another directory than data_dir.
  * @global string $attachment_dir
@@ -454,12 +454,12 @@ $attachment_dir = $data_dir;
 
 /**
  * Hash level used for data directory.
- * 
+ *
  * This option allows spliting file based squirrelmail user
  * data storage directory into several subfolders. Number from
  * 0 to 4 allows allows having up to four subfolder levels.
  *
- * Hashing should speed up directory access if you have big number 
+ * Hashing should speed up directory access if you have big number
  * of users (500 and more).
  * @global integer $dir_hash_level
  */
@@ -496,7 +496,7 @@ $default_use_priority = true;
 /**
  * SquirrelMail Attributions Control
  *
- * This option disables display of "created by squirrelmail developers" 
+ * This option disables display of "created by squirrelmail developers"
  * strings and provider link
  * @global bool $hide_sm_attributions
  */
@@ -528,7 +528,7 @@ $edit_name = true;
  * Server Side Threading Control
  *
  * If you want to enable server side thread sorting options
- * Your IMAP server must support the THREAD extension for 
+ * Your IMAP server must support the THREAD extension for
  * this to work.
  * @global bool $allow_thread_sort
  */
@@ -548,7 +548,7 @@ $allow_server_sort = false;
  * IMAP Charset Use Control
  *
  * This option allows you to choose if SM uses charset search
- * Your imap server should support SEARCH CHARSET command for 
+ * Your imap server should support SEARCH CHARSET command for
  * this to work.
  * @global bool $allow_charset_search
  */
@@ -582,9 +582,9 @@ $session_name = 'SQMSESSID';
  *
  * To add a new theme to the options that users can choose from, just
  * add a new number to the array at the bottom, and follow the pattern.
- * 
+ *
  * $theme_default sets theme that will be used by default
- * $theme_css sets stylesheet (from theme/css directory) that will be 
+ * $theme_css sets stylesheet (from theme/css directory) that will be
  * used by default.
  * @global integer $theme_default
  * @global string $theme_css
@@ -718,7 +718,7 @@ $theme[36]['NAME'] = 'Redmond';
  *       'host' => 'memberdir.netscape.com',
  *       'name' => 'Netcenter Member Directory',
  *       'base' => 'ou=member_directory,o=netcenter.com'
- *   ); 
+ *   );
  */
 // Add your ldap server options here
 
@@ -749,7 +749,7 @@ $abook_global_file_writeable = false;
 /**
  * MOTD
  *
- * This is a message that is displayed immediately after a user logs in. 
+ * This is a message that is displayed immediately after a user logs in.
  * @global string $motd
  */
 $motd = "";
@@ -768,7 +768,7 @@ $motd = "";
 
 /*** Database ***/
 /**
- * Read doc/database.txt in order to get more information 
+ * Read doc/database.txt in order to get more information
  * about these settings.
  */
 /**
@@ -805,7 +805,7 @@ $addrbook_global_listing = false;
  *
  *   This is the default language. It is used as a last resort
  *   if SquirrelMail can't figure out which language to display.
- *   Language names usually consist of language code, undercore 
+ *   Language names usually consist of language code, undercore
  *   symbol and country code
  * @global string $squirrelmail_default_language
  */
@@ -839,7 +839,7 @@ $available_languages   = 'all';
 /**
  * Alternative Language Names Control
  *
- * This options allows displaying native language names in language 
+ * This options allows displaying native language names in language
  * selection box.
  * @global bool $show_alternative_names
  * @since 1.5.0
@@ -849,7 +849,7 @@ $show_alternative_names   = false;
 /**
  * Aggressive Decoding Control
  *
- * This option enables reading of Eastern multibyte encodings. 
+ * This option enables reading of Eastern multibyte encodings.
  * Functions that provide this support are very cpu and memory intensive.
  * Don't enable this option unless you really need it.
  * @global bool $aggressive_decoding
@@ -860,8 +860,8 @@ $aggressive_decoding = false;
 /**
  * Lossy Encoding Control
  *
- * This option allows charset conversions when output charset does not support 
- * all symbols used in original charset. Symbols unsupported by output charset 
+ * This option allows charset conversions when output charset does not support
+ * all symbols used in original charset. Symbols unsupported by output charset
  * will be replaced with question marks.
  * @global bool $lossy_encoding
  * @since 1.5.1
@@ -870,7 +870,7 @@ $lossy_encoding = false;
 
 /*** Tweaks ***/
 /**
- * Advanced DHTML tree control 
+ * Advanced DHTML tree control
  *
  * Use experimental DHTML folder listing
  * @global bool $advanced_tree
@@ -900,8 +900,8 @@ $use_icons = false;
  * Use experimental code with php recode functions when reading messages with
  * different encoding. This code is faster that original SM functions,
  * but it require php with recode support.
- * 
- * Don't enable this option if you are not sure about availability of 
+ *
+ * Don't enable this option if you are not sure about availability of
  * recode support.
  * @global bool $use_php_recode
  * @since 1.5.0
@@ -914,8 +914,8 @@ $use_php_recode = false;
  * Use experimental code with php iconv functions when reading messages with
  * different encoding. This code is faster that original SM functions,
  * but it require php with iconv support and works only with some translations.
- * 
- * Don't enable this option if you are not sure about availability of 
+ *
+ * Don't enable this option if you are not sure about availability of
  * iconv support.
  * @global bool $use_php_iconv
  * @since 1.5.0
@@ -929,7 +929,7 @@ $use_php_iconv = false;
  * generate the folder subscribe listbox (this can take a long time
  * when you have a lot of folders).  Instead, a textbox will be
  * displayed allowing users to enter a specific folder name to subscribe to
- * 
+ *
  * This option can't be changed by conf.pl
  * @global bool $no_list_for_subscribe
  */
@@ -939,7 +939,7 @@ $no_list_for_subscribe = false;
  * Color in config control
  *
  * This option is used only by conf.pl script to generate configuration
- * menu with some colors and is provided here only as reference. 
+ * menu with some colors and is provided here only as reference.
  * @global integer $config_use_color
  */
 $config_use_color = 2;
@@ -956,4 +956,4 @@ $config_use_color = 2;
  * sent and regular output to begin, which will majorly screw
  * things up when we try to send more headers later.
  */
-?>
+?>

+ 2 - 2
config/config_local.php

@@ -4,10 +4,10 @@
  *
  * You can override the config.php settings here.
  * Don't do it unless you know what you're doing.
- * Use standard PHP syntax, see config.php for examples. 
+ * Use standard PHP syntax, see config.php for examples.
  *
  * @package squirrelmail
  * @subpackage config
  */
 
-?>
+?>

+ 1 - 1
config/index.php

@@ -17,4 +17,4 @@ header("Location:../index.php");
 
 /* pretty impressive huh? */
 
-?>
+?>

+ 1 - 1
contrib/RPM/config.php.redhat

@@ -174,4 +174,4 @@ $session_name = 'SQMSESSID';
  * sent and regular output to begin, which will majorly screw
  * things up when we try to send more headers later.
  */
-?>
+?>

+ 1 - 1
data/index.php

@@ -17,4 +17,4 @@ header("Location:../index.php");
 
 /* pretty impressive huh? */
 
-?>
+?>

+ 3 - 3
functions/abook_database.php

@@ -212,9 +212,9 @@ class abook_database extends addressbook_backend {
             return false;
         }
 
-	if(isset($this->listing) && !$this->listing) {
-	    return array();
-	}
+        if(isset($this->listing) && !$this->listing) {
+            return array();
+        }
 
 
         $query = sprintf("SELECT * FROM %s WHERE owner='%s'",

+ 2 - 2
functions/abook_local_file.php

@@ -22,7 +22,7 @@
  * ? create    => if true: file is created if it does not exist.
  * ? umask     => umask set before opening file.
  * ? name      => name of address book.
- * ? detect_writeable => detect address book access permissions by 
+ * ? detect_writeable => detect address book access permissions by
  *                checking file permissions.
  * ? writeable => allow writing into address book. Used only when
  *                detect_writeable is set to false.
@@ -34,7 +34,7 @@
 class abook_local_file extends addressbook_backend {
     /**
      * Backend type
-     * @var string 
+     * @var string
      */
     var $btype = 'local';
     /**

+ 3 - 3
functions/addressbook.php

@@ -76,7 +76,7 @@ function addressbook_init($showerr = true, $onlylocal = false) {
 
     /* This would be for the global addressbook */
     if (isset($abook_global_file) && isset($abook_global_file_writeable)
-	&& trim($abook_global_file)!=''){
+        && trim($abook_global_file)!=''){
         // Detect place of address book
         if (! preg_match("/[\/\\\]/",$abook_global_file)) {
             // no path chars
@@ -620,7 +620,7 @@ class AddressBook {
     }
 
     /**
-     * Create a new address 
+     * Create a new address
      * @param array $userdata added address record
      * @param integer $bnum backend number
      * @return integer the backend number that the/ address was added
@@ -671,7 +671,7 @@ class AddressBook {
 
     /**
      * Remove the entries from address book
-     * @param mixed $alias entries that have to be removed. Can be string with nickname or array with list of nicknames 
+     * @param mixed $alias entries that have to be removed. Can be string with nickname or array with list of nicknames
      * @param integer $bnum backend number
      * @return bool true if removed successfully. false if there s an error. $this->error contains error message
      */

+ 7 - 7
functions/auth.php

@@ -43,13 +43,13 @@ function is_logged_in() {
         return;
     } else {
         global $PHP_SELF, $session_expired_post,
-	       $session_expired_location, $squirrelmail_language;
+               $session_expired_location, $squirrelmail_language;
 
         /*  First we store some information in the new session to prevent
          *  information-loss.
          */
 
-	$session_expired_post = $_POST;
+        $session_expired_post = $_POST;
         $session_expired_location = $PHP_SELF;
         if (!sqsession_is_registered('session_expired_post')) {
            sqsession_register($session_expired_post,'session_expired_post');
@@ -110,7 +110,7 @@ function digest_md5_response ($username,$password,$challenge,$service,$host) {
 
   /* This can be auth (authentication only), auth-int (integrity protection), or
      auth-conf (confidentiality protection).  Right now only auth is supported.
-	 DO NOT CHANGE THIS VALUE */
+     DO NOT CHANGE THIS VALUE */
   $qop_value = "auth";
 
   $digest_uri_value = $service . '/' . $host;
@@ -175,10 +175,10 @@ function digest_md5_parse_challenge($challenge) {
       // We're in a "simple" value - explode to next comma
       $val=explode(',',$challenge,2);
       if (isset($val[1])) {
-	  	$challenge=$val[1];
-	  } else {
-	    unset($challenge);
-	  }
+          $challenge=$val[1];
+      } else {
+          unset($challenge);
+      }
       $value=$val[0];
     }
     $parsed["$key"]=$value;

+ 4 - 4
functions/date.php

@@ -290,9 +290,9 @@ function date_intl( $date_format, $stamp ) {
     $aParts = explode('#',$ret);
     $ret = str_replace(array('$1','$4','$2','$3',), array(getDayAbrv($aParts[0]),
                                                           getMonthAbrv($aParts[1]),
-                   				          getMonthName($aParts[1]),
-						          getDayName($aParts[0])),
-						          $aParts[2]);
+                                                          getMonthName($aParts[1]),
+                                                          getDayName($aParts[0])),
+                                                          $aParts[2]);
     return( $ret );
 }
 
@@ -447,4 +447,4 @@ function getTimeStamp($dateParts) {
       return ($mtime);
    }
 */
-?>
+?>

+ 130 - 130
functions/decode/cp1250.php

@@ -7,7 +7,7 @@
  *
  * This file contains cp1250 decoding function that is needed to read
  * cp1250 encoded mails in non-cp1250 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT
  *
@@ -39,134 +39,134 @@ function charset_decode_cp1250 ($string) {
         return $string;
 
     $cp1250 = array(
-	"\x80" => '&#8364;',
-	"\x81" => '&#65533;',
-	"\x82" => '&#8218;',
-	"\x83" => '&#65533;',
-	"\x84" => '&#8222;',
-	"\x85" => '&#8230;',
-	"\x86" => '&#8224;',
-	"\x87" => '&#8225;',
-	"\x88" => '&#65533;',
-	"\x89" => '&#8240;',
-	"\x8A" => '&#352;',
-	"\x8B" => '&#8249;',
-	"\x8C" => '&#346;',
-	"\x8D" => '&#356;',
-	"\x8E" => '&#381;',
-	"\x8F" => '&#377;',
-	"\x90" => '&#65533;',
-	"\x91" => '&#8216;',
-	"\x92" => '&#8217;',
-	"\x93" => '&#8220;',
-	"\x94" => '&#8221;',
-	"\x95" => '&#8226;',
-	"\x96" => '&#8211;',
-	"\x97" => '&#8212;',
-	"\x98" => '&#65533;',
-	"\x99" => '&#8482;',
-	"\x9A" => '&#353;',
-	"\x9B" => '&#8250;',
-	"\x9C" => '&#347;',
-	"\x9D" => '&#357;',
-	"\x9E" => '&#382;',
-	"\x9F" => '&#378;',
-	"\xA0" => '&#160;',
-	"\xA1" => '&#711;',
-	"\xA2" => '&#728;',
-	"\xA3" => '&#321;',
-	"\xA4" => '&#164;',
-	"\xA5" => '&#260;',
-	"\xA6" => '&#166;',
-	"\xA7" => '&#167;',
-	"\xA8" => '&#168;',
-	"\xA9" => '&#169;',
-	"\xAA" => '&#350;',
-	"\xAB" => '&#171;',
-	"\xAC" => '&#172;',
-	"\xAD" => '&#173;',
-	"\xAE" => '&#174;',
-	"\xAF" => '&#379;',
-	"\xB0" => '&#176;',
-	"\xB1" => '&#177;',
-	"\xB2" => '&#731;',
-	"\xB3" => '&#322;',
-	"\xB4" => '&#180;',
-	"\xB5" => '&#181;',
-	"\xB6" => '&#182;',
-	"\xB7" => '&#183;',
-	"\xB8" => '&#184;',
-	"\xB9" => '&#261;',
-	"\xBA" => '&#351;',
-	"\xBB" => '&#187;',
-	"\xBC" => '&#317;',
-	"\xBD" => '&#733;',
-	"\xBE" => '&#318;',
-	"\xBF" => '&#380;',
-	"\xC0" => '&#340;',
-	"\xC1" => '&#193;',
-	"\xC2" => '&#194;',
-	"\xC3" => '&#258;',
-	"\xC4" => '&#196;',
-	"\xC5" => '&#313;',
-	"\xC6" => '&#262;',
-	"\xC7" => '&#199;',
-	"\xC8" => '&#268;',
-	"\xC9" => '&#201;',
-	"\xCA" => '&#280;',
-	"\xCB" => '&#203;',
-	"\xCC" => '&#282;',
-	"\xCD" => '&#205;',
-	"\xCE" => '&#206;',
-	"\xCF" => '&#270;',
-	"\xD0" => '&#272;',
-	"\xD1" => '&#323;',
-	"\xD2" => '&#327;',
-	"\xD3" => '&#211;',
-	"\xD4" => '&#212;',
-	"\xD5" => '&#336;',
-	"\xD6" => '&#214;',
-	"\xD7" => '&#215;',
-	"\xD8" => '&#344;',
-	"\xD9" => '&#366;',
-	"\xDA" => '&#218;',
-	"\xDB" => '&#368;',
-	"\xDC" => '&#220;',
-	"\xDD" => '&#221;',
-	"\xDE" => '&#354;',
-	"\xDF" => '&#223;',
-	"\xE0" => '&#341;',
-	"\xE1" => '&#225;',
-	"\xE2" => '&#226;',
-	"\xE3" => '&#259;',
-	"\xE4" => '&#228;',
-	"\xE5" => '&#314;',
-	"\xE6" => '&#263;',
-	"\xE7" => '&#231;',
-	"\xE8" => '&#269;',
-	"\xE9" => '&#233;',
-	"\xEA" => '&#281;',
-	"\xEB" => '&#235;',
-	"\xEC" => '&#283;',
-	"\xED" => '&#237;',
-	"\xEE" => '&#238;',
-	"\xEF" => '&#271;',
-	"\xF0" => '&#273;',
-	"\xF1" => '&#324;',
-	"\xF2" => '&#328;',
-	"\xF3" => '&#243;',
-	"\xF4" => '&#244;',
-	"\xF5" => '&#337;',
-	"\xF6" => '&#246;',
-	"\xF7" => '&#247;',
-	"\xF8" => '&#345;',
-	"\xF9" => '&#367;',
-	"\xFA" => '&#250;',
-	"\xFB" => '&#369;',
-	"\xFC" => '&#252;',
-	"\xFD" => '&#253;',
-	"\xFE" => '&#355;',
-	"\xFF" => '&#729;'
+        "\x80" => '&#8364;',
+        "\x81" => '&#65533;',
+        "\x82" => '&#8218;',
+        "\x83" => '&#65533;',
+        "\x84" => '&#8222;',
+        "\x85" => '&#8230;',
+        "\x86" => '&#8224;',
+        "\x87" => '&#8225;',
+        "\x88" => '&#65533;',
+        "\x89" => '&#8240;',
+        "\x8A" => '&#352;',
+        "\x8B" => '&#8249;',
+        "\x8C" => '&#346;',
+        "\x8D" => '&#356;',
+        "\x8E" => '&#381;',
+        "\x8F" => '&#377;',
+        "\x90" => '&#65533;',
+        "\x91" => '&#8216;',
+        "\x92" => '&#8217;',
+        "\x93" => '&#8220;',
+        "\x94" => '&#8221;',
+        "\x95" => '&#8226;',
+        "\x96" => '&#8211;',
+        "\x97" => '&#8212;',
+        "\x98" => '&#65533;',
+        "\x99" => '&#8482;',
+        "\x9A" => '&#353;',
+        "\x9B" => '&#8250;',
+        "\x9C" => '&#347;',
+        "\x9D" => '&#357;',
+        "\x9E" => '&#382;',
+        "\x9F" => '&#378;',
+        "\xA0" => '&#160;',
+        "\xA1" => '&#711;',
+        "\xA2" => '&#728;',
+        "\xA3" => '&#321;',
+        "\xA4" => '&#164;',
+        "\xA5" => '&#260;',
+        "\xA6" => '&#166;',
+        "\xA7" => '&#167;',
+        "\xA8" => '&#168;',
+        "\xA9" => '&#169;',
+        "\xAA" => '&#350;',
+        "\xAB" => '&#171;',
+        "\xAC" => '&#172;',
+        "\xAD" => '&#173;',
+        "\xAE" => '&#174;',
+        "\xAF" => '&#379;',
+        "\xB0" => '&#176;',
+        "\xB1" => '&#177;',
+        "\xB2" => '&#731;',
+        "\xB3" => '&#322;',
+        "\xB4" => '&#180;',
+        "\xB5" => '&#181;',
+        "\xB6" => '&#182;',
+        "\xB7" => '&#183;',
+        "\xB8" => '&#184;',
+        "\xB9" => '&#261;',
+        "\xBA" => '&#351;',
+        "\xBB" => '&#187;',
+        "\xBC" => '&#317;',
+        "\xBD" => '&#733;',
+        "\xBE" => '&#318;',
+        "\xBF" => '&#380;',
+        "\xC0" => '&#340;',
+        "\xC1" => '&#193;',
+        "\xC2" => '&#194;',
+        "\xC3" => '&#258;',
+        "\xC4" => '&#196;',
+        "\xC5" => '&#313;',
+        "\xC6" => '&#262;',
+        "\xC7" => '&#199;',
+        "\xC8" => '&#268;',
+        "\xC9" => '&#201;',
+        "\xCA" => '&#280;',
+        "\xCB" => '&#203;',
+        "\xCC" => '&#282;',
+        "\xCD" => '&#205;',
+        "\xCE" => '&#206;',
+        "\xCF" => '&#270;',
+        "\xD0" => '&#272;',
+        "\xD1" => '&#323;',
+        "\xD2" => '&#327;',
+        "\xD3" => '&#211;',
+        "\xD4" => '&#212;',
+        "\xD5" => '&#336;',
+        "\xD6" => '&#214;',
+        "\xD7" => '&#215;',
+        "\xD8" => '&#344;',
+        "\xD9" => '&#366;',
+        "\xDA" => '&#218;',
+        "\xDB" => '&#368;',
+        "\xDC" => '&#220;',
+        "\xDD" => '&#221;',
+        "\xDE" => '&#354;',
+        "\xDF" => '&#223;',
+        "\xE0" => '&#341;',
+        "\xE1" => '&#225;',
+        "\xE2" => '&#226;',
+        "\xE3" => '&#259;',
+        "\xE4" => '&#228;',
+        "\xE5" => '&#314;',
+        "\xE6" => '&#263;',
+        "\xE7" => '&#231;',
+        "\xE8" => '&#269;',
+        "\xE9" => '&#233;',
+        "\xEA" => '&#281;',
+        "\xEB" => '&#235;',
+        "\xEC" => '&#283;',
+        "\xED" => '&#237;',
+        "\xEE" => '&#238;',
+        "\xEF" => '&#271;',
+        "\xF0" => '&#273;',
+        "\xF1" => '&#324;',
+        "\xF2" => '&#328;',
+        "\xF3" => '&#243;',
+        "\xF4" => '&#244;',
+        "\xF5" => '&#337;',
+        "\xF6" => '&#246;',
+        "\xF7" => '&#247;',
+        "\xF8" => '&#345;',
+        "\xF9" => '&#367;',
+        "\xFA" => '&#250;',
+        "\xFB" => '&#369;',
+        "\xFC" => '&#252;',
+        "\xFD" => '&#253;',
+        "\xFE" => '&#355;',
+        "\xFF" => '&#729;'
     );
 
     $string = str_replace(array_keys($cp1250), array_values($cp1250), $string);
@@ -174,4 +174,4 @@ function charset_decode_cp1250 ($string) {
     return $string;
 }
 
-?>
+?>

+ 130 - 130
functions/decode/cp1251.php

@@ -7,7 +7,7 @@
  *
  * This file contains cp1251 decoding function that is needed to read
  * cp1251 encoded mails in non-cp1251 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT
  *
@@ -39,134 +39,134 @@ function charset_decode_cp1251 ($string) {
         return $string;
 
     $cp1251 = array(
-	"\x80" => '&#1026;',
-	"\x81" => '&#1027;',
-	"\x82" => '&#8218;',
-	"\x83" => '&#1107;',
-	"\x84" => '&#8222;',
-	"\x85" => '&#8230;',
-	"\x86" => '&#8224;',
-	"\x87" => '&#8225;',
-	"\x88" => '&#8364;',
-	"\x89" => '&#8240;',
-	"\x8A" => '&#1033;',
-	"\x8B" => '&#8249;',
-	"\x8C" => '&#1034;',
-	"\x8D" => '&#1036;',
-	"\x8E" => '&#1035;',
-	"\x8F" => '&#1039;',
-	"\x90" => '&#1106;',
-	"\x91" => '&#8216;',
-	"\x92" => '&#8217;',
-	"\x93" => '&#8220;',
-	"\x94" => '&#8221;',
-	"\x95" => '&#8226;',
-	"\x96" => '&#8211;',
-	"\x97" => '&#8212;',
-	"\x98" => '&#65533;',
-	"\x99" => '&#8482;',
-	"\x9A" => '&#1113;',
-	"\x9B" => '&#8250;',
-	"\x9C" => '&#1114;',
-	"\x9D" => '&#1116;',
-	"\x9E" => '&#1115;',
-	"\x9F" => '&#1119;',
-	"\xA0" => '&#160;',
-	"\xA1" => '&#1038;',
-	"\xA2" => '&#1118;',
-	"\xA3" => '&#1032;',
-	"\xA4" => '&#164;',
-	"\xA5" => '&#1168;',
-	"\xA6" => '&#166;',
-	"\xA7" => '&#167;',
-	"\xA8" => '&#1025;',
-	"\xA9" => '&#169;',
-	"\xAA" => '&#1028;',
-	"\xAB" => '&#171;',
-	"\xAC" => '&#172;',
-	"\xAD" => '&#173;',
-	"\xAE" => '&#174;',
-	"\xAF" => '&#1031;',
-	"\xB0" => '&#176;',
-	"\xB1" => '&#177;',
-	"\xB2" => '&#1030;',
-	"\xB3" => '&#1110;',
-	"\xB4" => '&#1169;',
-	"\xB5" => '&#181;',
-	"\xB6" => '&#182;',
-	"\xB7" => '&#183;',
-	"\xB8" => '&#1105;',
-	"\xB9" => '&#8470;',
-	"\xBA" => '&#1108;',
-	"\xBB" => '&#187;',
-	"\xBC" => '&#1112;',
-	"\xBD" => '&#1029;',
-	"\xBE" => '&#1109;',
-	"\xBF" => '&#1111;',
-	"\xC0" => '&#1040;',
-	"\xC1" => '&#1041;',
-	"\xC2" => '&#1042;',
-	"\xC3" => '&#1043;',
-	"\xC4" => '&#1044;',
-	"\xC5" => '&#1045;',
-	"\xC6" => '&#1046;',
-	"\xC7" => '&#1047;',
-	"\xC8" => '&#1048;',
-	"\xC9" => '&#1049;',
-	"\xCA" => '&#1050;',
-	"\xCB" => '&#1051;',
-	"\xCC" => '&#1052;',
-	"\xCD" => '&#1053;',
-	"\xCE" => '&#1054;',
-	"\xCF" => '&#1055;',
-	"\xD0" => '&#1056;',
-	"\xD1" => '&#1057;',
-	"\xD2" => '&#1058;',
-	"\xD3" => '&#1059;',
-	"\xD4" => '&#1060;',
-	"\xD5" => '&#1061;',
-	"\xD6" => '&#1062;',
-	"\xD7" => '&#1063;',
-	"\xD8" => '&#1064;',
-	"\xD9" => '&#1065;',
-	"\xDA" => '&#1066;',
-	"\xDB" => '&#1067;',
-	"\xDC" => '&#1068;',
-	"\xDD" => '&#1069;',
-	"\xDE" => '&#1070;',
-	"\xDF" => '&#1071;',
-	"\xE0" => '&#1072;',
-	"\xE1" => '&#1073;',
-	"\xE2" => '&#1074;',
-	"\xE3" => '&#1075;',
-	"\xE4" => '&#1076;',
-	"\xE5" => '&#1077;',
-	"\xE6" => '&#1078;',
-	"\xE7" => '&#1079;',
-	"\xE8" => '&#1080;',
-	"\xE9" => '&#1081;',
-	"\xEA" => '&#1082;',
-	"\xEB" => '&#1083;',
-	"\xEC" => '&#1084;',
-	"\xED" => '&#1085;',
-	"\xEE" => '&#1086;',
-	"\xEF" => '&#1087;',
-	"\xF0" => '&#1088;',
-	"\xF1" => '&#1089;',
-	"\xF2" => '&#1090;',
-	"\xF3" => '&#1091;',
-	"\xF4" => '&#1092;',
-	"\xF5" => '&#1093;',
-	"\xF6" => '&#1094;',
-	"\xF7" => '&#1095;',
-	"\xF8" => '&#1096;',
-	"\xF9" => '&#1097;',
-	"\xFA" => '&#1098;',
-	"\xFB" => '&#1099;',
-	"\xFC" => '&#1100;',
-	"\xFD" => '&#1101;',
-	"\xFE" => '&#1102;',
-	"\xFF" => '&#1103;'
+        "\x80" => '&#1026;',
+        "\x81" => '&#1027;',
+        "\x82" => '&#8218;',
+        "\x83" => '&#1107;',
+        "\x84" => '&#8222;',
+        "\x85" => '&#8230;',
+        "\x86" => '&#8224;',
+        "\x87" => '&#8225;',
+        "\x88" => '&#8364;',
+        "\x89" => '&#8240;',
+        "\x8A" => '&#1033;',
+        "\x8B" => '&#8249;',
+        "\x8C" => '&#1034;',
+        "\x8D" => '&#1036;',
+        "\x8E" => '&#1035;',
+        "\x8F" => '&#1039;',
+        "\x90" => '&#1106;',
+        "\x91" => '&#8216;',
+        "\x92" => '&#8217;',
+        "\x93" => '&#8220;',
+        "\x94" => '&#8221;',
+        "\x95" => '&#8226;',
+        "\x96" => '&#8211;',
+        "\x97" => '&#8212;',
+        "\x98" => '&#65533;',
+        "\x99" => '&#8482;',
+        "\x9A" => '&#1113;',
+        "\x9B" => '&#8250;',
+        "\x9C" => '&#1114;',
+        "\x9D" => '&#1116;',
+        "\x9E" => '&#1115;',
+        "\x9F" => '&#1119;',
+        "\xA0" => '&#160;',
+        "\xA1" => '&#1038;',
+        "\xA2" => '&#1118;',
+        "\xA3" => '&#1032;',
+        "\xA4" => '&#164;',
+        "\xA5" => '&#1168;',
+        "\xA6" => '&#166;',
+        "\xA7" => '&#167;',
+        "\xA8" => '&#1025;',
+        "\xA9" => '&#169;',
+        "\xAA" => '&#1028;',
+        "\xAB" => '&#171;',
+        "\xAC" => '&#172;',
+        "\xAD" => '&#173;',
+        "\xAE" => '&#174;',
+        "\xAF" => '&#1031;',
+        "\xB0" => '&#176;',
+        "\xB1" => '&#177;',
+        "\xB2" => '&#1030;',
+        "\xB3" => '&#1110;',
+        "\xB4" => '&#1169;',
+        "\xB5" => '&#181;',
+        "\xB6" => '&#182;',
+        "\xB7" => '&#183;',
+        "\xB8" => '&#1105;',
+        "\xB9" => '&#8470;',
+        "\xBA" => '&#1108;',
+        "\xBB" => '&#187;',
+        "\xBC" => '&#1112;',
+        "\xBD" => '&#1029;',
+        "\xBE" => '&#1109;',
+        "\xBF" => '&#1111;',
+        "\xC0" => '&#1040;',
+        "\xC1" => '&#1041;',
+        "\xC2" => '&#1042;',
+        "\xC3" => '&#1043;',
+        "\xC4" => '&#1044;',
+        "\xC5" => '&#1045;',
+        "\xC6" => '&#1046;',
+        "\xC7" => '&#1047;',
+        "\xC8" => '&#1048;',
+        "\xC9" => '&#1049;',
+        "\xCA" => '&#1050;',
+        "\xCB" => '&#1051;',
+        "\xCC" => '&#1052;',
+        "\xCD" => '&#1053;',
+        "\xCE" => '&#1054;',
+        "\xCF" => '&#1055;',
+        "\xD0" => '&#1056;',
+        "\xD1" => '&#1057;',
+        "\xD2" => '&#1058;',
+        "\xD3" => '&#1059;',
+        "\xD4" => '&#1060;',
+        "\xD5" => '&#1061;',
+        "\xD6" => '&#1062;',
+        "\xD7" => '&#1063;',
+        "\xD8" => '&#1064;',
+        "\xD9" => '&#1065;',
+        "\xDA" => '&#1066;',
+        "\xDB" => '&#1067;',
+        "\xDC" => '&#1068;',
+        "\xDD" => '&#1069;',
+        "\xDE" => '&#1070;',
+        "\xDF" => '&#1071;',
+        "\xE0" => '&#1072;',
+        "\xE1" => '&#1073;',
+        "\xE2" => '&#1074;',
+        "\xE3" => '&#1075;',
+        "\xE4" => '&#1076;',
+        "\xE5" => '&#1077;',
+        "\xE6" => '&#1078;',
+        "\xE7" => '&#1079;',
+        "\xE8" => '&#1080;',
+        "\xE9" => '&#1081;',
+        "\xEA" => '&#1082;',
+        "\xEB" => '&#1083;',
+        "\xEC" => '&#1084;',
+        "\xED" => '&#1085;',
+        "\xEE" => '&#1086;',
+        "\xEF" => '&#1087;',
+        "\xF0" => '&#1088;',
+        "\xF1" => '&#1089;',
+        "\xF2" => '&#1090;',
+        "\xF3" => '&#1091;',
+        "\xF4" => '&#1092;',
+        "\xF5" => '&#1093;',
+        "\xF6" => '&#1094;',
+        "\xF7" => '&#1095;',
+        "\xF8" => '&#1096;',
+        "\xF9" => '&#1097;',
+        "\xFA" => '&#1098;',
+        "\xFB" => '&#1099;',
+        "\xFC" => '&#1100;',
+        "\xFD" => '&#1101;',
+        "\xFE" => '&#1102;',
+        "\xFF" => '&#1103;'
     );
 
     $string = str_replace(array_keys($cp1251), array_values($cp1251), $string);
@@ -174,4 +174,4 @@ function charset_decode_cp1251 ($string) {
     return $string;
 }
 
-?>
+?>

+ 130 - 130
functions/decode/cp1252.php

@@ -7,7 +7,7 @@
  *
  * This file contains cp1252 decoding function that is needed to read
  * cp1252 encoded mails in non-cp1252 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT
  *
@@ -40,134 +40,134 @@ function charset_decode_cp1252 ($string) {
         return $string;
 
     $cp1252 = array(
-	"\x80" => '&#8364;',
-	"\x81" => '&#65533;',
-	"\x82" => '&#8218;',
-	"\x83" => '&#402;',
-	"\x84" => '&#8222;',
-	"\x85" => '&#8230;',
-	"\x86" => '&#8224;',
-	"\x87" => '&#8225;',
-	"\x88" => '&#710;',
-	"\x89" => '&#8240;',
-	"\x8A" => '&#352;',
-	"\x8B" => '&#8249;',
-	"\x8C" => '&#338;',
-	"\x8D" => '&#65533;',
-	"\x8E" => '&#381;',
-	"\x8F" => '&#65533;',
-	"\x90" => '&#65533;',
-	"\x91" => '&#8216;',
-	"\x92" => '&#8217;',
-	"\x93" => '&#8220;',
-	"\x94" => '&#8221;',
-	"\x95" => '&#8226;',
-	"\x96" => '&#8211;',
-	"\x97" => '&#8212;',
-	"\x98" => '&#732;',
-	"\x99" => '&#8482;',
-	"\x9A" => '&#353;',
-	"\x9B" => '&#8250;',
-	"\x9C" => '&#339;',
-	"\x9D" => '&#65533;',
-	"\x9E" => '&#382;',
-	"\x9F" => '&#376;',
-	"\xA0" => '&#160;',
-	"\xA1" => '&#161;',
-	"\xA2" => '&#162;',
-	"\xA3" => '&#163;',
-	"\xA4" => '&#164;',
-	"\xA5" => '&#165;',
-	"\xA6" => '&#166;',
-	"\xA7" => '&#167;',
-	"\xA8" => '&#168;',
-	"\xA9" => '&#169;',
-	"\xAA" => '&#170;',
-	"\xAB" => '&#171;',
-	"\xAC" => '&#172;',
-	"\xAD" => '&#173;',
-	"\xAE" => '&#174;',
-	"\xAF" => '&#175;',
-	"\xB0" => '&#176;',
-	"\xB1" => '&#177;',
-	"\xB2" => '&#178;',
-	"\xB3" => '&#179;',
-	"\xB4" => '&#180;',
-	"\xB5" => '&#181;',
-	"\xB6" => '&#182;',
-	"\xB7" => '&#183;',
-	"\xB8" => '&#184;',
-	"\xB9" => '&#185;',
-	"\xBA" => '&#186;',
-	"\xBB" => '&#187;',
-	"\xBC" => '&#188;',
-	"\xBD" => '&#189;',
-	"\xBE" => '&#190;',
-	"\xBF" => '&#191;',
-	"\xC0" => '&#192;',
-	"\xC1" => '&#193;',
-	"\xC2" => '&#194;',
-	"\xC3" => '&#195;',
-	"\xC4" => '&#196;',
-	"\xC5" => '&#197;',
-	"\xC6" => '&#198;',
-	"\xC7" => '&#199;',
-	"\xC8" => '&#200;',
-	"\xC9" => '&#201;',
-	"\xCA" => '&#202;',
-	"\xCB" => '&#203;',
-	"\xCC" => '&#204;',
-	"\xCD" => '&#205;',
-	"\xCE" => '&#206;',
-	"\xCF" => '&#207;',
-	"\xD0" => '&#208;',
-	"\xD1" => '&#209;',
-	"\xD2" => '&#210;',
-	"\xD3" => '&#211;',
-	"\xD4" => '&#212;',
-	"\xD5" => '&#213;',
-	"\xD6" => '&#214;',
-	"\xD7" => '&#215;',
-	"\xD8" => '&#216;',
-	"\xD9" => '&#217;',
-	"\xDA" => '&#218;',
-	"\xDB" => '&#219;',
-	"\xDC" => '&#220;',
-	"\xDD" => '&#221;',
-	"\xDE" => '&#222;',
-	"\xDF" => '&#223;',
-	"\xE0" => '&#224;',
-	"\xE1" => '&#225;',
-	"\xE2" => '&#226;',
-	"\xE3" => '&#227;',
-	"\xE4" => '&#228;',
-	"\xE5" => '&#229;',
-	"\xE6" => '&#230;',
-	"\xE7" => '&#231;',
-	"\xE8" => '&#232;',
-	"\xE9" => '&#233;',
-	"\xEA" => '&#234;',
-	"\xEB" => '&#235;',
-	"\xEC" => '&#236;',
-	"\xED" => '&#237;',
-	"\xEE" => '&#238;',
-	"\xEF" => '&#239;',
-	"\xF0" => '&#240;',
-	"\xF1" => '&#241;',
-	"\xF2" => '&#242;',
-	"\xF3" => '&#243;',
-	"\xF4" => '&#244;',
-	"\xF5" => '&#245;',
-	"\xF6" => '&#246;',
-	"\xF7" => '&#247;',
-	"\xF8" => '&#248;',
-	"\xF9" => '&#249;',
-	"\xFA" => '&#250;',
-	"\xFB" => '&#251;',
-	"\xFC" => '&#252;',
-	"\xFD" => '&#253;',
-	"\xFE" => '&#254;',
-	"\xFF" => '&#255;'
+        "\x80" => '&#8364;',
+        "\x81" => '&#65533;',
+        "\x82" => '&#8218;',
+        "\x83" => '&#402;',
+        "\x84" => '&#8222;',
+        "\x85" => '&#8230;',
+        "\x86" => '&#8224;',
+        "\x87" => '&#8225;',
+        "\x88" => '&#710;',
+        "\x89" => '&#8240;',
+        "\x8A" => '&#352;',
+        "\x8B" => '&#8249;',
+        "\x8C" => '&#338;',
+        "\x8D" => '&#65533;',
+        "\x8E" => '&#381;',
+        "\x8F" => '&#65533;',
+        "\x90" => '&#65533;',
+        "\x91" => '&#8216;',
+        "\x92" => '&#8217;',
+        "\x93" => '&#8220;',
+        "\x94" => '&#8221;',
+        "\x95" => '&#8226;',
+        "\x96" => '&#8211;',
+        "\x97" => '&#8212;',
+        "\x98" => '&#732;',
+        "\x99" => '&#8482;',
+        "\x9A" => '&#353;',
+        "\x9B" => '&#8250;',
+        "\x9C" => '&#339;',
+        "\x9D" => '&#65533;',
+        "\x9E" => '&#382;',
+        "\x9F" => '&#376;',
+        "\xA0" => '&#160;',
+        "\xA1" => '&#161;',
+        "\xA2" => '&#162;',
+        "\xA3" => '&#163;',
+        "\xA4" => '&#164;',
+        "\xA5" => '&#165;',
+        "\xA6" => '&#166;',
+        "\xA7" => '&#167;',
+        "\xA8" => '&#168;',
+        "\xA9" => '&#169;',
+        "\xAA" => '&#170;',
+        "\xAB" => '&#171;',
+        "\xAC" => '&#172;',
+        "\xAD" => '&#173;',
+        "\xAE" => '&#174;',
+        "\xAF" => '&#175;',
+        "\xB0" => '&#176;',
+        "\xB1" => '&#177;',
+        "\xB2" => '&#178;',
+        "\xB3" => '&#179;',
+        "\xB4" => '&#180;',
+        "\xB5" => '&#181;',
+        "\xB6" => '&#182;',
+        "\xB7" => '&#183;',
+        "\xB8" => '&#184;',
+        "\xB9" => '&#185;',
+        "\xBA" => '&#186;',
+        "\xBB" => '&#187;',
+        "\xBC" => '&#188;',
+        "\xBD" => '&#189;',
+        "\xBE" => '&#190;',
+        "\xBF" => '&#191;',
+        "\xC0" => '&#192;',
+        "\xC1" => '&#193;',
+        "\xC2" => '&#194;',
+        "\xC3" => '&#195;',
+        "\xC4" => '&#196;',
+        "\xC5" => '&#197;',
+        "\xC6" => '&#198;',
+        "\xC7" => '&#199;',
+        "\xC8" => '&#200;',
+        "\xC9" => '&#201;',
+        "\xCA" => '&#202;',
+        "\xCB" => '&#203;',
+        "\xCC" => '&#204;',
+        "\xCD" => '&#205;',
+        "\xCE" => '&#206;',
+        "\xCF" => '&#207;',
+        "\xD0" => '&#208;',
+        "\xD1" => '&#209;',
+        "\xD2" => '&#210;',
+        "\xD3" => '&#211;',
+        "\xD4" => '&#212;',
+        "\xD5" => '&#213;',
+        "\xD6" => '&#214;',
+        "\xD7" => '&#215;',
+        "\xD8" => '&#216;',
+        "\xD9" => '&#217;',
+        "\xDA" => '&#218;',
+        "\xDB" => '&#219;',
+        "\xDC" => '&#220;',
+        "\xDD" => '&#221;',
+        "\xDE" => '&#222;',
+        "\xDF" => '&#223;',
+        "\xE0" => '&#224;',
+        "\xE1" => '&#225;',
+        "\xE2" => '&#226;',
+        "\xE3" => '&#227;',
+        "\xE4" => '&#228;',
+        "\xE5" => '&#229;',
+        "\xE6" => '&#230;',
+        "\xE7" => '&#231;',
+        "\xE8" => '&#232;',
+        "\xE9" => '&#233;',
+        "\xEA" => '&#234;',
+        "\xEB" => '&#235;',
+        "\xEC" => '&#236;',
+        "\xED" => '&#237;',
+        "\xEE" => '&#238;',
+        "\xEF" => '&#239;',
+        "\xF0" => '&#240;',
+        "\xF1" => '&#241;',
+        "\xF2" => '&#242;',
+        "\xF3" => '&#243;',
+        "\xF4" => '&#244;',
+        "\xF5" => '&#245;',
+        "\xF6" => '&#246;',
+        "\xF7" => '&#247;',
+        "\xF8" => '&#248;',
+        "\xF9" => '&#249;',
+        "\xFA" => '&#250;',
+        "\xFB" => '&#251;',
+        "\xFC" => '&#252;',
+        "\xFD" => '&#253;',
+        "\xFE" => '&#254;',
+        "\xFF" => '&#255;'
     );
 
     $string = str_replace(array_keys($cp1252), array_values($cp1252), $string);
@@ -175,4 +175,4 @@ function charset_decode_cp1252 ($string) {
     return $string;
 }
 
-?>
+?>

+ 130 - 130
functions/decode/cp1253.php

@@ -7,7 +7,7 @@
  *
  * This file contains cp1253 decoding function that is needed to read
  * cp1253 encoded mails in non-cp1253 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.TXT
  *
@@ -39,134 +39,134 @@ function charset_decode_cp1253 ($string) {
         return $string;
 
     $cp1253 = array(
-	"\x80" => '&#8364;',
-	"\x81" => '&#65533;',
-	"\x82" => '&#8218;',
-	"\x83" => '&#402;',
-	"\x84" => '&#8222;',
-	"\x85" => '&#8230;',
-	"\x86" => '&#8224;',
-	"\x87" => '&#8225;',
-	"\x88" => '&#65533;',
-	"\x89" => '&#8240;',
-	"\x8A" => '&#65533;',
-	"\x8B" => '&#8249;',
-	"\x8C" => '&#65533;',
-	"\x8D" => '&#65533;',
-	"\x8E" => '&#65533;',
-	"\x8F" => '&#65533;',
-	"\x90" => '&#65533;',
-	"\x91" => '&#8216;',
-	"\x92" => '&#8217;',
-	"\x93" => '&#8220;',
-	"\x94" => '&#8221;',
-	"\x95" => '&#8226;',
-	"\x96" => '&#8211;',
-	"\x97" => '&#8212;',
-	"\x98" => '&#65533;',
-	"\x99" => '&#8482;',
-	"\x9A" => '&#65533;',
-	"\x9B" => '&#8250;',
-	"\x9C" => '&#65533;',
-	"\x9D" => '&#65533;',
-	"\x9E" => '&#65533;',
-	"\x9F" => '&#65533;',
-	"\xA0" => '&#160;',
-	"\xA1" => '&#901;',
-	"\xA2" => '&#902;',
-	"\xA3" => '&#163;',
-	"\xA4" => '&#164;',
-	"\xA5" => '&#165;',
-	"\xA6" => '&#166;',
-	"\xA7" => '&#167;',
-	"\xA8" => '&#168;',
-	"\xA9" => '&#169;',
-	"\xAA" => '&#65533;',
-	"\xAB" => '&#171;',
-	"\xAC" => '&#172;',
-	"\xAD" => '&#173;',
-	"\xAE" => '&#174;',
-	"\xAF" => '&#8213;',
-	"\xB0" => '&#176;',
-	"\xB1" => '&#177;',
-	"\xB2" => '&#178;',
-	"\xB3" => '&#179;',
-	"\xB4" => '&#900;',
-	"\xB5" => '&#181;',
-	"\xB6" => '&#182;',
-	"\xB7" => '&#183;',
-	"\xB8" => '&#904;',
-	"\xB9" => '&#905;',
-	"\xBA" => '&#906;',
-	"\xBB" => '&#187;',
-	"\xBC" => '&#908;',
-	"\xBD" => '&#189;',
-	"\xBE" => '&#910;',
-	"\xBF" => '&#911;',
-	"\xC0" => '&#912;',
-	"\xC1" => '&#913;',
-	"\xC2" => '&#914;',
-	"\xC3" => '&#915;',
-	"\xC4" => '&#916;',
-	"\xC5" => '&#917;',
-	"\xC6" => '&#918;',
-	"\xC7" => '&#919;',
-	"\xC8" => '&#920;',
-	"\xC9" => '&#921;',
-	"\xCA" => '&#922;',
-	"\xCB" => '&#923;',
-	"\xCC" => '&#924;',
-	"\xCD" => '&#925;',
-	"\xCE" => '&#926;',
-	"\xCF" => '&#927;',
-	"\xD0" => '&#928;',
-	"\xD1" => '&#929;',
-	"\xD2" => '&#65533;',
-	"\xD3" => '&#931;',
-	"\xD4" => '&#932;',
-	"\xD5" => '&#933;',
-	"\xD6" => '&#934;',
-	"\xD7" => '&#935;',
-	"\xD8" => '&#936;',
-	"\xD9" => '&#937;',
-	"\xDA" => '&#938;',
-	"\xDB" => '&#939;',
-	"\xDC" => '&#940;',
-	"\xDD" => '&#941;',
-	"\xDE" => '&#942;',
-	"\xDF" => '&#943;',
-	"\xE0" => '&#944;',
-	"\xE1" => '&#945;',
-	"\xE2" => '&#946;',
-	"\xE3" => '&#947;',
-	"\xE4" => '&#948;',
-	"\xE5" => '&#949;',
-	"\xE6" => '&#950;',
-	"\xE7" => '&#951;',
-	"\xE8" => '&#952;',
-	"\xE9" => '&#953;',
-	"\xEA" => '&#954;',
-	"\xEB" => '&#955;',
-	"\xEC" => '&#956;',
-	"\xED" => '&#957;',
-	"\xEE" => '&#958;',
-	"\xEF" => '&#959;',
-	"\xF0" => '&#960;',
-	"\xF1" => '&#961;',
-	"\xF2" => '&#962;',
-	"\xF3" => '&#963;',
-	"\xF4" => '&#964;',
-	"\xF5" => '&#965;',
-	"\xF6" => '&#966;',
-	"\xF7" => '&#967;',
-	"\xF8" => '&#968;',
-	"\xF9" => '&#969;',
-	"\xFA" => '&#970;',
-	"\xFB" => '&#971;',
-	"\xFC" => '&#972;',
-	"\xFD" => '&#973;',
-	"\xFE" => '&#974;',
-	"\xFF" => '&#65533;'
+        "\x80" => '&#8364;',
+        "\x81" => '&#65533;',
+        "\x82" => '&#8218;',
+        "\x83" => '&#402;',
+        "\x84" => '&#8222;',
+        "\x85" => '&#8230;',
+        "\x86" => '&#8224;',
+        "\x87" => '&#8225;',
+        "\x88" => '&#65533;',
+        "\x89" => '&#8240;',
+        "\x8A" => '&#65533;',
+        "\x8B" => '&#8249;',
+        "\x8C" => '&#65533;',
+        "\x8D" => '&#65533;',
+        "\x8E" => '&#65533;',
+        "\x8F" => '&#65533;',
+        "\x90" => '&#65533;',
+        "\x91" => '&#8216;',
+        "\x92" => '&#8217;',
+        "\x93" => '&#8220;',
+        "\x94" => '&#8221;',
+        "\x95" => '&#8226;',
+        "\x96" => '&#8211;',
+        "\x97" => '&#8212;',
+        "\x98" => '&#65533;',
+        "\x99" => '&#8482;',
+        "\x9A" => '&#65533;',
+        "\x9B" => '&#8250;',
+        "\x9C" => '&#65533;',
+        "\x9D" => '&#65533;',
+        "\x9E" => '&#65533;',
+        "\x9F" => '&#65533;',
+        "\xA0" => '&#160;',
+        "\xA1" => '&#901;',
+        "\xA2" => '&#902;',
+        "\xA3" => '&#163;',
+        "\xA4" => '&#164;',
+        "\xA5" => '&#165;',
+        "\xA6" => '&#166;',
+        "\xA7" => '&#167;',
+        "\xA8" => '&#168;',
+        "\xA9" => '&#169;',
+        "\xAA" => '&#65533;',
+        "\xAB" => '&#171;',
+        "\xAC" => '&#172;',
+        "\xAD" => '&#173;',
+        "\xAE" => '&#174;',
+        "\xAF" => '&#8213;',
+        "\xB0" => '&#176;',
+        "\xB1" => '&#177;',
+        "\xB2" => '&#178;',
+        "\xB3" => '&#179;',
+        "\xB4" => '&#900;',
+        "\xB5" => '&#181;',
+        "\xB6" => '&#182;',
+        "\xB7" => '&#183;',
+        "\xB8" => '&#904;',
+        "\xB9" => '&#905;',
+        "\xBA" => '&#906;',
+        "\xBB" => '&#187;',
+        "\xBC" => '&#908;',
+        "\xBD" => '&#189;',
+        "\xBE" => '&#910;',
+        "\xBF" => '&#911;',
+        "\xC0" => '&#912;',
+        "\xC1" => '&#913;',
+        "\xC2" => '&#914;',
+        "\xC3" => '&#915;',
+        "\xC4" => '&#916;',
+        "\xC5" => '&#917;',
+        "\xC6" => '&#918;',
+        "\xC7" => '&#919;',
+        "\xC8" => '&#920;',
+        "\xC9" => '&#921;',
+        "\xCA" => '&#922;',
+        "\xCB" => '&#923;',
+        "\xCC" => '&#924;',
+        "\xCD" => '&#925;',
+        "\xCE" => '&#926;',
+        "\xCF" => '&#927;',
+        "\xD0" => '&#928;',
+        "\xD1" => '&#929;',
+        "\xD2" => '&#65533;',
+        "\xD3" => '&#931;',
+        "\xD4" => '&#932;',
+        "\xD5" => '&#933;',
+        "\xD6" => '&#934;',
+        "\xD7" => '&#935;',
+        "\xD8" => '&#936;',
+        "\xD9" => '&#937;',
+        "\xDA" => '&#938;',
+        "\xDB" => '&#939;',
+        "\xDC" => '&#940;',
+        "\xDD" => '&#941;',
+        "\xDE" => '&#942;',
+        "\xDF" => '&#943;',
+        "\xE0" => '&#944;',
+        "\xE1" => '&#945;',
+        "\xE2" => '&#946;',
+        "\xE3" => '&#947;',
+        "\xE4" => '&#948;',
+        "\xE5" => '&#949;',
+        "\xE6" => '&#950;',
+        "\xE7" => '&#951;',
+        "\xE8" => '&#952;',
+        "\xE9" => '&#953;',
+        "\xEA" => '&#954;',
+        "\xEB" => '&#955;',
+        "\xEC" => '&#956;',
+        "\xED" => '&#957;',
+        "\xEE" => '&#958;',
+        "\xEF" => '&#959;',
+        "\xF0" => '&#960;',
+        "\xF1" => '&#961;',
+        "\xF2" => '&#962;',
+        "\xF3" => '&#963;',
+        "\xF4" => '&#964;',
+        "\xF5" => '&#965;',
+        "\xF6" => '&#966;',
+        "\xF7" => '&#967;',
+        "\xF8" => '&#968;',
+        "\xF9" => '&#969;',
+        "\xFA" => '&#970;',
+        "\xFB" => '&#971;',
+        "\xFC" => '&#972;',
+        "\xFD" => '&#973;',
+        "\xFE" => '&#974;',
+        "\xFF" => '&#65533;'
     );
 
     $string = str_replace(array_keys($cp1253), array_values($cp1253), $string);
@@ -174,4 +174,4 @@ function charset_decode_cp1253 ($string) {
     return $string;
 }
 
-?>
+?>

+ 130 - 130
functions/decode/cp1254.php

@@ -7,7 +7,7 @@
  *
  * This file contains cp1254 decoding function that is needed to read
  * cp1254 encoded mails in non-cp1254 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT
  *
@@ -39,134 +39,134 @@ function charset_decode_cp1254 ($string) {
         return $string;
 
     $cp1254 = array(
-	"\x80" => '&#8364;',
-	"\x81" => '&#65533;',
-	"\x82" => '&#8218;',
-	"\x83" => '&#402;',
-	"\x84" => '&#8222;',
-	"\x85" => '&#8230;',
-	"\x86" => '&#8224;',
-	"\x87" => '&#8225;',
-	"\x88" => '&#710;',
-	"\x89" => '&#8240;',
-	"\x8A" => '&#352;',
-	"\x8B" => '&#8249;',
-	"\x8C" => '&#338;',
-	"\x8D" => '&#65533;',
-	"\x8E" => '&#65533;',
-	"\x8F" => '&#65533;',
-	"\x90" => '&#65533;',
-	"\x91" => '&#8216;',
-	"\x92" => '&#8217;',
-	"\x93" => '&#8220;',
-	"\x94" => '&#8221;',
-	"\x95" => '&#8226;',
-	"\x96" => '&#8211;',
-	"\x97" => '&#8212;',
-	"\x98" => '&#732;',
-	"\x99" => '&#8482;',
-	"\x9A" => '&#353;',
-	"\x9B" => '&#8250;',
-	"\x9C" => '&#339;',
-	"\x9D" => '&#65533;',
-	"\x9E" => '&#65533;',
-	"\x9F" => '&#376;',
-	"\xA0" => '&#160;',
-	"\xA1" => '&#161;',
-	"\xA2" => '&#162;',
-	"\xA3" => '&#163;',
-	"\xA4" => '&#164;',
-	"\xA5" => '&#165;',
-	"\xA6" => '&#166;',
-	"\xA7" => '&#167;',
-	"\xA8" => '&#168;',
-	"\xA9" => '&#169;',
-	"\xAA" => '&#170;',
-	"\xAB" => '&#171;',
-	"\xAC" => '&#172;',
-	"\xAD" => '&#173;',
-	"\xAE" => '&#174;',
-	"\xAF" => '&#175;',
-	"\xB0" => '&#176;',
-	"\xB1" => '&#177;',
-	"\xB2" => '&#178;',
-	"\xB3" => '&#179;',
-	"\xB4" => '&#180;',
-	"\xB5" => '&#181;',
-	"\xB6" => '&#182;',
-	"\xB7" => '&#183;',
-	"\xB8" => '&#184;',
-	"\xB9" => '&#185;',
-	"\xBA" => '&#186;',
-	"\xBB" => '&#187;',
-	"\xBC" => '&#188;',
-	"\xBD" => '&#189;',
-	"\xBE" => '&#190;',
-	"\xBF" => '&#191;',
-	"\xC0" => '&#192;',
-	"\xC1" => '&#193;',
-	"\xC2" => '&#194;',
-	"\xC3" => '&#195;',
-	"\xC4" => '&#196;',
-	"\xC5" => '&#197;',
-	"\xC6" => '&#198;',
-	"\xC7" => '&#199;',
-	"\xC8" => '&#200;',
-	"\xC9" => '&#201;',
-	"\xCA" => '&#202;',
-	"\xCB" => '&#203;',
-	"\xCC" => '&#204;',
-	"\xCD" => '&#205;',
-	"\xCE" => '&#206;',
-	"\xCF" => '&#207;',
-	"\xD0" => '&#286;',
-	"\xD1" => '&#209;',
-	"\xD2" => '&#210;',
-	"\xD3" => '&#211;',
-	"\xD4" => '&#212;',
-	"\xD5" => '&#213;',
-	"\xD6" => '&#214;',
-	"\xD7" => '&#215;',
-	"\xD8" => '&#216;',
-	"\xD9" => '&#217;',
-	"\xDA" => '&#218;',
-	"\xDB" => '&#219;',
-	"\xDC" => '&#220;',
-	"\xDD" => '&#304;',
-	"\xDE" => '&#350;',
-	"\xDF" => '&#223;',
-	"\xE0" => '&#224;',
-	"\xE1" => '&#225;',
-	"\xE2" => '&#226;',
-	"\xE3" => '&#227;',
-	"\xE4" => '&#228;',
-	"\xE5" => '&#229;',
-	"\xE6" => '&#230;',
-	"\xE7" => '&#231;',
-	"\xE8" => '&#232;',
-	"\xE9" => '&#233;',
-	"\xEA" => '&#234;',
-	"\xEB" => '&#235;',
-	"\xEC" => '&#236;',
-	"\xED" => '&#237;',
-	"\xEE" => '&#238;',
-	"\xEF" => '&#239;',
-	"\xF0" => '&#287;',
-	"\xF1" => '&#241;',
-	"\xF2" => '&#242;',
-	"\xF3" => '&#243;',
-	"\xF4" => '&#244;',
-	"\xF5" => '&#245;',
-	"\xF6" => '&#246;',
-	"\xF7" => '&#247;',
-	"\xF8" => '&#248;',
-	"\xF9" => '&#249;',
-	"\xFA" => '&#250;',
-	"\xFB" => '&#251;',
-	"\xFC" => '&#252;',
-	"\xFD" => '&#305;',
-	"\xFE" => '&#351;',
-	"\xFF" => '&#255;'
+        "\x80" => '&#8364;',
+        "\x81" => '&#65533;',
+        "\x82" => '&#8218;',
+        "\x83" => '&#402;',
+        "\x84" => '&#8222;',
+        "\x85" => '&#8230;',
+        "\x86" => '&#8224;',
+        "\x87" => '&#8225;',
+        "\x88" => '&#710;',
+        "\x89" => '&#8240;',
+        "\x8A" => '&#352;',
+        "\x8B" => '&#8249;',
+        "\x8C" => '&#338;',
+        "\x8D" => '&#65533;',
+        "\x8E" => '&#65533;',
+        "\x8F" => '&#65533;',
+        "\x90" => '&#65533;',
+        "\x91" => '&#8216;',
+        "\x92" => '&#8217;',
+        "\x93" => '&#8220;',
+        "\x94" => '&#8221;',
+        "\x95" => '&#8226;',
+        "\x96" => '&#8211;',
+        "\x97" => '&#8212;',
+        "\x98" => '&#732;',
+        "\x99" => '&#8482;',
+        "\x9A" => '&#353;',
+        "\x9B" => '&#8250;',
+        "\x9C" => '&#339;',
+        "\x9D" => '&#65533;',
+        "\x9E" => '&#65533;',
+        "\x9F" => '&#376;',
+        "\xA0" => '&#160;',
+        "\xA1" => '&#161;',
+        "\xA2" => '&#162;',
+        "\xA3" => '&#163;',
+        "\xA4" => '&#164;',
+        "\xA5" => '&#165;',
+        "\xA6" => '&#166;',
+        "\xA7" => '&#167;',
+        "\xA8" => '&#168;',
+        "\xA9" => '&#169;',
+        "\xAA" => '&#170;',
+        "\xAB" => '&#171;',
+        "\xAC" => '&#172;',
+        "\xAD" => '&#173;',
+        "\xAE" => '&#174;',
+        "\xAF" => '&#175;',
+        "\xB0" => '&#176;',
+        "\xB1" => '&#177;',
+        "\xB2" => '&#178;',
+        "\xB3" => '&#179;',
+        "\xB4" => '&#180;',
+        "\xB5" => '&#181;',
+        "\xB6" => '&#182;',
+        "\xB7" => '&#183;',
+        "\xB8" => '&#184;',
+        "\xB9" => '&#185;',
+        "\xBA" => '&#186;',
+        "\xBB" => '&#187;',
+        "\xBC" => '&#188;',
+        "\xBD" => '&#189;',
+        "\xBE" => '&#190;',
+        "\xBF" => '&#191;',
+        "\xC0" => '&#192;',
+        "\xC1" => '&#193;',
+        "\xC2" => '&#194;',
+        "\xC3" => '&#195;',
+        "\xC4" => '&#196;',
+        "\xC5" => '&#197;',
+        "\xC6" => '&#198;',
+        "\xC7" => '&#199;',
+        "\xC8" => '&#200;',
+        "\xC9" => '&#201;',
+        "\xCA" => '&#202;',
+        "\xCB" => '&#203;',
+        "\xCC" => '&#204;',
+        "\xCD" => '&#205;',
+        "\xCE" => '&#206;',
+        "\xCF" => '&#207;',
+        "\xD0" => '&#286;',
+        "\xD1" => '&#209;',
+        "\xD2" => '&#210;',
+        "\xD3" => '&#211;',
+        "\xD4" => '&#212;',
+        "\xD5" => '&#213;',
+        "\xD6" => '&#214;',
+        "\xD7" => '&#215;',
+        "\xD8" => '&#216;',
+        "\xD9" => '&#217;',
+        "\xDA" => '&#218;',
+        "\xDB" => '&#219;',
+        "\xDC" => '&#220;',
+        "\xDD" => '&#304;',
+        "\xDE" => '&#350;',
+        "\xDF" => '&#223;',
+        "\xE0" => '&#224;',
+        "\xE1" => '&#225;',
+        "\xE2" => '&#226;',
+        "\xE3" => '&#227;',
+        "\xE4" => '&#228;',
+        "\xE5" => '&#229;',
+        "\xE6" => '&#230;',
+        "\xE7" => '&#231;',
+        "\xE8" => '&#232;',
+        "\xE9" => '&#233;',
+        "\xEA" => '&#234;',
+        "\xEB" => '&#235;',
+        "\xEC" => '&#236;',
+        "\xED" => '&#237;',
+        "\xEE" => '&#238;',
+        "\xEF" => '&#239;',
+        "\xF0" => '&#287;',
+        "\xF1" => '&#241;',
+        "\xF2" => '&#242;',
+        "\xF3" => '&#243;',
+        "\xF4" => '&#244;',
+        "\xF5" => '&#245;',
+        "\xF6" => '&#246;',
+        "\xF7" => '&#247;',
+        "\xF8" => '&#248;',
+        "\xF9" => '&#249;',
+        "\xFA" => '&#250;',
+        "\xFB" => '&#251;',
+        "\xFC" => '&#252;',
+        "\xFD" => '&#305;',
+        "\xFE" => '&#351;',
+        "\xFF" => '&#255;'
     );
 
     $string = str_replace(array_keys($cp1254), array_values($cp1254), $string);
@@ -174,4 +174,4 @@ function charset_decode_cp1254 ($string) {
     return $string;
 }
 
-?>
+?>

+ 130 - 130
functions/decode/cp1255.php

@@ -7,7 +7,7 @@
  *
  * This file contains cp1255 decoding function that is needed to read
  * cp1255 encoded mails in non-cp1255 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT
  *
@@ -39,134 +39,134 @@ function charset_decode_cp1255 ($string) {
         return $string;
 
     $cp1255 = array(
-	"\x80" => '&#8364;',
-	"\x81" => '&#65533;',
-	"\x82" => '&#8218;',
-	"\x83" => '&#402;',
-	"\x84" => '&#8222;',
-	"\x85" => '&#8230;',
-	"\x86" => '&#8224;',
-	"\x87" => '&#8225;',
-	"\x88" => '&#710;',
-	"\x89" => '&#8240;',
-	"\x8A" => '&#65533;',
-	"\x8B" => '&#8249;',
-	"\x8C" => '&#65533;',
-	"\x8D" => '&#65533;',
-	"\x8E" => '&#65533;',
-	"\x8F" => '&#65533;',
-	"\x90" => '&#65533;',
-	"\x91" => '&#8216;',
-	"\x92" => '&#8217;',
-	"\x93" => '&#8220;',
-	"\x94" => '&#8221;',
-	"\x95" => '&#8226;',
-	"\x96" => '&#8211;',
-	"\x97" => '&#8212;',
-	"\x98" => '&#732;',
-	"\x99" => '&#8482;',
-	"\x9A" => '&#65533;',
-	"\x9B" => '&#8250;',
-	"\x9C" => '&#65533;',
-	"\x9D" => '&#65533;',
-	"\x9E" => '&#65533;',
-	"\x9F" => '&#65533;',
-	"\xA0" => '&#160;',
-	"\xA1" => '&#161;',
-	"\xA2" => '&#162;',
-	"\xA3" => '&#163;',
-	"\xA4" => '&#8362;',
-	"\xA5" => '&#165;',
-	"\xA6" => '&#166;',
-	"\xA7" => '&#167;',
-	"\xA8" => '&#168;',
-	"\xA9" => '&#169;',
-	"\xAA" => '&#215;',
-	"\xAB" => '&#171;',
-	"\xAC" => '&#172;',
-	"\xAD" => '&#173;',
-	"\xAE" => '&#174;',
-	"\xAF" => '&#175;',
-	"\xB0" => '&#176;',
-	"\xB1" => '&#177;',
-	"\xB2" => '&#178;',
-	"\xB3" => '&#179;',
-	"\xB4" => '&#180;',
-	"\xB5" => '&#181;',
-	"\xB6" => '&#182;',
-	"\xB7" => '&#183;',
-	"\xB8" => '&#184;',
-	"\xB9" => '&#185;',
-	"\xBA" => '&#247;',
-	"\xBB" => '&#187;',
-	"\xBC" => '&#188;',
-	"\xBD" => '&#189;',
-	"\xBE" => '&#190;',
-	"\xBF" => '&#191;',
-	"\xC0" => '&#1456;',
-	"\xC1" => '&#1457;',
-	"\xC2" => '&#1458;',
-	"\xC3" => '&#1459;',
-	"\xC4" => '&#1460;',
-	"\xC5" => '&#1461;',
-	"\xC6" => '&#1462;',
-	"\xC7" => '&#1463;',
-	"\xC8" => '&#1464;',
-	"\xC9" => '&#1465;',
-	"\xCA" => '&#65533;',
-	"\xCB" => '&#1467;',
-	"\xCC" => '&#1468;',
-	"\xCD" => '&#1469;',
-	"\xCE" => '&#1470;',
-	"\xCF" => '&#1471;',
-	"\xD0" => '&#1472;',
-	"\xD1" => '&#1473;',
-	"\xD2" => '&#1474;',
-	"\xD3" => '&#1475;',
-	"\xD4" => '&#1520;',
-	"\xD5" => '&#1521;',
-	"\xD6" => '&#1522;',
-	"\xD7" => '&#1523;',
-	"\xD8" => '&#1524;',
-	"\xD9" => '&#65533;',
-	"\xDA" => '&#65533;',
-	"\xDB" => '&#65533;',
-	"\xDC" => '&#65533;',
-	"\xDD" => '&#65533;',
-	"\xDE" => '&#65533;',
-	"\xDF" => '&#65533;',
-	"\xE0" => '&#1488;',
-	"\xE1" => '&#1489;',
-	"\xE2" => '&#1490;',
-	"\xE3" => '&#1491;',
-	"\xE4" => '&#1492;',
-	"\xE5" => '&#1493;',
-	"\xE6" => '&#1494;',
-	"\xE7" => '&#1495;',
-	"\xE8" => '&#1496;',
-	"\xE9" => '&#1497;',
-	"\xEA" => '&#1498;',
-	"\xEB" => '&#1499;',
-	"\xEC" => '&#1500;',
-	"\xED" => '&#1501;',
-	"\xEE" => '&#1502;',
-	"\xEF" => '&#1503;',
-	"\xF0" => '&#1504;',
-	"\xF1" => '&#1505;',
-	"\xF2" => '&#1506;',
-	"\xF3" => '&#1507;',
-	"\xF4" => '&#1508;',
-	"\xF5" => '&#1509;',
-	"\xF6" => '&#1510;',
-	"\xF7" => '&#1511;',
-	"\xF8" => '&#1512;',
-	"\xF9" => '&#1513;',
-	"\xFA" => '&#1514;',
-	"\xFB" => '&#65533;',
-	"\xFC" => '&#65533;',
-	"\xFD" => '&#8206;',
-	"\xFE" => '&#8207;',
-	"\xFF" => '&#65533;'
+        "\x80" => '&#8364;',
+        "\x81" => '&#65533;',
+        "\x82" => '&#8218;',
+        "\x83" => '&#402;',
+        "\x84" => '&#8222;',
+        "\x85" => '&#8230;',
+        "\x86" => '&#8224;',
+        "\x87" => '&#8225;',
+        "\x88" => '&#710;',
+        "\x89" => '&#8240;',
+        "\x8A" => '&#65533;',
+        "\x8B" => '&#8249;',
+        "\x8C" => '&#65533;',
+        "\x8D" => '&#65533;',
+        "\x8E" => '&#65533;',
+        "\x8F" => '&#65533;',
+        "\x90" => '&#65533;',
+        "\x91" => '&#8216;',
+        "\x92" => '&#8217;',
+        "\x93" => '&#8220;',
+        "\x94" => '&#8221;',
+        "\x95" => '&#8226;',
+        "\x96" => '&#8211;',
+        "\x97" => '&#8212;',
+        "\x98" => '&#732;',
+        "\x99" => '&#8482;',
+        "\x9A" => '&#65533;',
+        "\x9B" => '&#8250;',
+        "\x9C" => '&#65533;',
+        "\x9D" => '&#65533;',
+        "\x9E" => '&#65533;',
+        "\x9F" => '&#65533;',
+        "\xA0" => '&#160;',
+        "\xA1" => '&#161;',
+        "\xA2" => '&#162;',
+        "\xA3" => '&#163;',
+        "\xA4" => '&#8362;',
+        "\xA5" => '&#165;',
+        "\xA6" => '&#166;',
+        "\xA7" => '&#167;',
+        "\xA8" => '&#168;',
+        "\xA9" => '&#169;',
+        "\xAA" => '&#215;',
+        "\xAB" => '&#171;',
+        "\xAC" => '&#172;',
+        "\xAD" => '&#173;',
+        "\xAE" => '&#174;',
+        "\xAF" => '&#175;',
+        "\xB0" => '&#176;',
+        "\xB1" => '&#177;',
+        "\xB2" => '&#178;',
+        "\xB3" => '&#179;',
+        "\xB4" => '&#180;',
+        "\xB5" => '&#181;',
+        "\xB6" => '&#182;',
+        "\xB7" => '&#183;',
+        "\xB8" => '&#184;',
+        "\xB9" => '&#185;',
+        "\xBA" => '&#247;',
+        "\xBB" => '&#187;',
+        "\xBC" => '&#188;',
+        "\xBD" => '&#189;',
+        "\xBE" => '&#190;',
+        "\xBF" => '&#191;',
+        "\xC0" => '&#1456;',
+        "\xC1" => '&#1457;',
+        "\xC2" => '&#1458;',
+        "\xC3" => '&#1459;',
+        "\xC4" => '&#1460;',
+        "\xC5" => '&#1461;',
+        "\xC6" => '&#1462;',
+        "\xC7" => '&#1463;',
+        "\xC8" => '&#1464;',
+        "\xC9" => '&#1465;',
+        "\xCA" => '&#65533;',
+        "\xCB" => '&#1467;',
+        "\xCC" => '&#1468;',
+        "\xCD" => '&#1469;',
+        "\xCE" => '&#1470;',
+        "\xCF" => '&#1471;',
+        "\xD0" => '&#1472;',
+        "\xD1" => '&#1473;',
+        "\xD2" => '&#1474;',
+        "\xD3" => '&#1475;',
+        "\xD4" => '&#1520;',
+        "\xD5" => '&#1521;',
+        "\xD6" => '&#1522;',
+        "\xD7" => '&#1523;',
+        "\xD8" => '&#1524;',
+        "\xD9" => '&#65533;',
+        "\xDA" => '&#65533;',
+        "\xDB" => '&#65533;',
+        "\xDC" => '&#65533;',
+        "\xDD" => '&#65533;',
+        "\xDE" => '&#65533;',
+        "\xDF" => '&#65533;',
+        "\xE0" => '&#1488;',
+        "\xE1" => '&#1489;',
+        "\xE2" => '&#1490;',
+        "\xE3" => '&#1491;',
+        "\xE4" => '&#1492;',
+        "\xE5" => '&#1493;',
+        "\xE6" => '&#1494;',
+        "\xE7" => '&#1495;',
+        "\xE8" => '&#1496;',
+        "\xE9" => '&#1497;',
+        "\xEA" => '&#1498;',
+        "\xEB" => '&#1499;',
+        "\xEC" => '&#1500;',
+        "\xED" => '&#1501;',
+        "\xEE" => '&#1502;',
+        "\xEF" => '&#1503;',
+        "\xF0" => '&#1504;',
+        "\xF1" => '&#1505;',
+        "\xF2" => '&#1506;',
+        "\xF3" => '&#1507;',
+        "\xF4" => '&#1508;',
+        "\xF5" => '&#1509;',
+        "\xF6" => '&#1510;',
+        "\xF7" => '&#1511;',
+        "\xF8" => '&#1512;',
+        "\xF9" => '&#1513;',
+        "\xFA" => '&#1514;',
+        "\xFB" => '&#65533;',
+        "\xFC" => '&#65533;',
+        "\xFD" => '&#8206;',
+        "\xFE" => '&#8207;',
+        "\xFF" => '&#65533;'
     );
 
     $string = str_replace(array_keys($cp1255), array_values($cp1255), $string);
@@ -174,4 +174,4 @@ function charset_decode_cp1255 ($string) {
     return $string;
 }
 
-?>
+?>

+ 130 - 130
functions/decode/cp1256.php

@@ -7,7 +7,7 @@
  *
  * This file contains cp1256 decoding function that is needed to read
  * cp1256 encoded mails in non-cp1256 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.TXT
  *
@@ -39,134 +39,134 @@ function charset_decode_cp1256 ($string) {
         return $string;
 
     $cp1256 = array(
-	"\x80" => '&#8364;',
-	"\x81" => '&#1662;',
-	"\x82" => '&#8218;',
-	"\x83" => '&#402;',
-	"\x84" => '&#8222;',
-	"\x85" => '&#8230;',
-	"\x86" => '&#8224;',
-	"\x87" => '&#8225;',
-	"\x88" => '&#710;',
-	"\x89" => '&#8240;',
-	"\x8A" => '&#1657;',
-	"\x8B" => '&#8249;',
-	"\x8C" => '&#338;',
-	"\x8D" => '&#1670;',
-	"\x8E" => '&#1688;',
-	"\x8F" => '&#1672;',
-	"\x90" => '&#1711;',
-	"\x91" => '&#8216;',
-	"\x92" => '&#8217;',
-	"\x93" => '&#8220;',
-	"\x94" => '&#8221;',
-	"\x95" => '&#8226;',
-	"\x96" => '&#8211;',
-	"\x97" => '&#8212;',
-	"\x98" => '&#1705;',
-	"\x99" => '&#8482;',
-	"\x9A" => '&#1681;',
-	"\x9B" => '&#8250;',
-	"\x9C" => '&#339;',
-	"\x9D" => '&#8204;',
-	"\x9E" => '&#8205;',
-	"\x9F" => '&#1722;',
-	"\xA0" => '&#160;',
-	"\xA1" => '&#1548;',
-	"\xA2" => '&#162;',
-	"\xA3" => '&#163;',
-	"\xA4" => '&#164;',
-	"\xA5" => '&#165;',
-	"\xA6" => '&#166;',
-	"\xA7" => '&#167;',
-	"\xA8" => '&#168;',
-	"\xA9" => '&#169;',
-	"\xAA" => '&#1726;',
-	"\xAB" => '&#171;',
-	"\xAC" => '&#172;',
-	"\xAD" => '&#173;',
-	"\xAE" => '&#174;',
-	"\xAF" => '&#175;',
-	"\xB0" => '&#176;',
-	"\xB1" => '&#177;',
-	"\xB2" => '&#178;',
-	"\xB3" => '&#179;',
-	"\xB4" => '&#180;',
-	"\xB5" => '&#181;',
-	"\xB6" => '&#182;',
-	"\xB7" => '&#183;',
-	"\xB8" => '&#184;',
-	"\xB9" => '&#185;',
-	"\xBA" => '&#1563;',
-	"\xBB" => '&#187;',
-	"\xBC" => '&#188;',
-	"\xBD" => '&#189;',
-	"\xBE" => '&#190;',
-	"\xBF" => '&#1567;',
-	"\xC0" => '&#1729;',
-	"\xC1" => '&#1569;',
-	"\xC2" => '&#1570;',
-	"\xC3" => '&#1571;',
-	"\xC4" => '&#1572;',
-	"\xC5" => '&#1573;',
-	"\xC6" => '&#1574;',
-	"\xC7" => '&#1575;',
-	"\xC8" => '&#1576;',
-	"\xC9" => '&#1577;',
-	"\xCA" => '&#1578;',
-	"\xCB" => '&#1579;',
-	"\xCC" => '&#1580;',
-	"\xCD" => '&#1581;',
-	"\xCE" => '&#1582;',
-	"\xCF" => '&#1583;',
-	"\xD0" => '&#1584;',
-	"\xD1" => '&#1585;',
-	"\xD2" => '&#1586;',
-	"\xD3" => '&#1587;',
-	"\xD4" => '&#1588;',
-	"\xD5" => '&#1589;',
-	"\xD6" => '&#1590;',
-	"\xD7" => '&#215;',
-	"\xD8" => '&#1591;',
-	"\xD9" => '&#1592;',
-	"\xDA" => '&#1593;',
-	"\xDB" => '&#1594;',
-	"\xDC" => '&#1600;',
-	"\xDD" => '&#1601;',
-	"\xDE" => '&#1602;',
-	"\xDF" => '&#1603;',
-	"\xE0" => '&#224;',
-	"\xE1" => '&#1604;',
-	"\xE2" => '&#226;',
-	"\xE3" => '&#1605;',
-	"\xE4" => '&#1606;',
-	"\xE5" => '&#1607;',
-	"\xE6" => '&#1608;',
-	"\xE7" => '&#231;',
-	"\xE8" => '&#232;',
-	"\xE9" => '&#233;',
-	"\xEA" => '&#234;',
-	"\xEB" => '&#235;',
-	"\xEC" => '&#1609;',
-	"\xED" => '&#1610;',
-	"\xEE" => '&#238;',
-	"\xEF" => '&#239;',
-	"\xF0" => '&#1611;',
-	"\xF1" => '&#1612;',
-	"\xF2" => '&#1613;',
-	"\xF3" => '&#1614;',
-	"\xF4" => '&#244;',
-	"\xF5" => '&#1615;',
-	"\xF6" => '&#1616;',
-	"\xF7" => '&#247;',
-	"\xF8" => '&#1617;',
-	"\xF9" => '&#249;',
-	"\xFA" => '&#1618;',
-	"\xFB" => '&#251;',
-	"\xFC" => '&#252;',
-	"\xFD" => '&#8206;',
-	"\xFE" => '&#8207;',
-	"\xFF" => '&#1746;'
+        "\x80" => '&#8364;',
+        "\x81" => '&#1662;',
+        "\x82" => '&#8218;',
+        "\x83" => '&#402;',
+        "\x84" => '&#8222;',
+        "\x85" => '&#8230;',
+        "\x86" => '&#8224;',
+        "\x87" => '&#8225;',
+        "\x88" => '&#710;',
+        "\x89" => '&#8240;',
+        "\x8A" => '&#1657;',
+        "\x8B" => '&#8249;',
+        "\x8C" => '&#338;',
+        "\x8D" => '&#1670;',
+        "\x8E" => '&#1688;',
+        "\x8F" => '&#1672;',
+        "\x90" => '&#1711;',
+        "\x91" => '&#8216;',
+        "\x92" => '&#8217;',
+        "\x93" => '&#8220;',
+        "\x94" => '&#8221;',
+        "\x95" => '&#8226;',
+        "\x96" => '&#8211;',
+        "\x97" => '&#8212;',
+        "\x98" => '&#1705;',
+        "\x99" => '&#8482;',
+        "\x9A" => '&#1681;',
+        "\x9B" => '&#8250;',
+        "\x9C" => '&#339;',
+        "\x9D" => '&#8204;',
+        "\x9E" => '&#8205;',
+        "\x9F" => '&#1722;',
+        "\xA0" => '&#160;',
+        "\xA1" => '&#1548;',
+        "\xA2" => '&#162;',
+        "\xA3" => '&#163;',
+        "\xA4" => '&#164;',
+        "\xA5" => '&#165;',
+        "\xA6" => '&#166;',
+        "\xA7" => '&#167;',
+        "\xA8" => '&#168;',
+        "\xA9" => '&#169;',
+        "\xAA" => '&#1726;',
+        "\xAB" => '&#171;',
+        "\xAC" => '&#172;',
+        "\xAD" => '&#173;',
+        "\xAE" => '&#174;',
+        "\xAF" => '&#175;',
+        "\xB0" => '&#176;',
+        "\xB1" => '&#177;',
+        "\xB2" => '&#178;',
+        "\xB3" => '&#179;',
+        "\xB4" => '&#180;',
+        "\xB5" => '&#181;',
+        "\xB6" => '&#182;',
+        "\xB7" => '&#183;',
+        "\xB8" => '&#184;',
+        "\xB9" => '&#185;',
+        "\xBA" => '&#1563;',
+        "\xBB" => '&#187;',
+        "\xBC" => '&#188;',
+        "\xBD" => '&#189;',
+        "\xBE" => '&#190;',
+        "\xBF" => '&#1567;',
+        "\xC0" => '&#1729;',
+        "\xC1" => '&#1569;',
+        "\xC2" => '&#1570;',
+        "\xC3" => '&#1571;',
+        "\xC4" => '&#1572;',
+        "\xC5" => '&#1573;',
+        "\xC6" => '&#1574;',
+        "\xC7" => '&#1575;',
+        "\xC8" => '&#1576;',
+        "\xC9" => '&#1577;',
+        "\xCA" => '&#1578;',
+        "\xCB" => '&#1579;',
+        "\xCC" => '&#1580;',
+        "\xCD" => '&#1581;',
+        "\xCE" => '&#1582;',
+        "\xCF" => '&#1583;',
+        "\xD0" => '&#1584;',
+        "\xD1" => '&#1585;',
+        "\xD2" => '&#1586;',
+        "\xD3" => '&#1587;',
+        "\xD4" => '&#1588;',
+        "\xD5" => '&#1589;',
+        "\xD6" => '&#1590;',
+        "\xD7" => '&#215;',
+        "\xD8" => '&#1591;',
+        "\xD9" => '&#1592;',
+        "\xDA" => '&#1593;',
+        "\xDB" => '&#1594;',
+        "\xDC" => '&#1600;',
+        "\xDD" => '&#1601;',
+        "\xDE" => '&#1602;',
+        "\xDF" => '&#1603;',
+        "\xE0" => '&#224;',
+        "\xE1" => '&#1604;',
+        "\xE2" => '&#226;',
+        "\xE3" => '&#1605;',
+        "\xE4" => '&#1606;',
+        "\xE5" => '&#1607;',
+        "\xE6" => '&#1608;',
+        "\xE7" => '&#231;',
+        "\xE8" => '&#232;',
+        "\xE9" => '&#233;',
+        "\xEA" => '&#234;',
+        "\xEB" => '&#235;',
+        "\xEC" => '&#1609;',
+        "\xED" => '&#1610;',
+        "\xEE" => '&#238;',
+        "\xEF" => '&#239;',
+        "\xF0" => '&#1611;',
+        "\xF1" => '&#1612;',
+        "\xF2" => '&#1613;',
+        "\xF3" => '&#1614;',
+        "\xF4" => '&#244;',
+        "\xF5" => '&#1615;',
+        "\xF6" => '&#1616;',
+        "\xF7" => '&#247;',
+        "\xF8" => '&#1617;',
+        "\xF9" => '&#249;',
+        "\xFA" => '&#1618;',
+        "\xFB" => '&#251;',
+        "\xFC" => '&#252;',
+        "\xFD" => '&#8206;',
+        "\xFE" => '&#8207;',
+        "\xFF" => '&#1746;'
     );
 
     $string = str_replace(array_keys($cp1256), array_values($cp1256), $string);
@@ -174,4 +174,4 @@ function charset_decode_cp1256 ($string) {
     return $string;
 }
 
-?>
+?>

+ 118 - 118
functions/decode/cp1257.php

@@ -7,7 +7,7 @@
  *
  * This file contains cp1257 decoding function that is needed to read
  * cp1257 encoded mails in non-cp1257 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT
  *
@@ -39,122 +39,122 @@ function charset_decode_cp1257 ($string) {
         return $string;
 
     $cp1257 = array(
-	"\x80" => '&#8364;',
-	"\x82" => '&#8218;',
-	"\x84" => '&#8222;',
-	"\x85" => '&#8230;',
-	"\x86" => '&#8224;',
-	"\x87" => '&#8225;',
-	"\x89" => '&#8240;',
-	"\x8B" => '&#8249;',
-	"\x8D" => '&#168;',
-	"\x8E" => '&#711;',
-	"\x8F" => '&#184;',
-	"\x91" => '&#8216;',
-	"\x92" => '&#8217;',
-	"\x93" => '&#8220;',
-	"\x94" => '&#8221;',
-	"\x95" => '&#8226;',
-	"\x96" => '&#8211;',
-	"\x97" => '&#8212;',
-	"\x99" => '&#8482;',
-	"\x9B" => '&#8250;',
-	"\x9D" => '&#175;',
-	"\x9E" => '&#731;',
-	"\xA0" => '&#160;',
-	"\xA2" => '&#162;',
-	"\xA3" => '&#163;',
-	"\xA4" => '&#164;',
-	"\xA6" => '&#166;',
-	"\xA7" => '&#167;',
-	"\xA8" => '&#216;',
-	"\xA9" => '&#169;',
-	"\xAA" => '&#342;',
-	"\xAB" => '&#171;',
-	"\xAC" => '&#172;',
-	"\xAD" => '&#173;',
-	"\xAE" => '&#174;',
-	"\xAF" => '&#198;',
-	"\xB0" => '&#176;',
-	"\xB1" => '&#177;',
-	"\xB2" => '&#178;',
-	"\xB3" => '&#179;',
-	"\xB4" => '&#180;',
-	"\xB5" => '&#181;',
-	"\xB6" => '&#182;',
-	"\xB7" => '&#183;',
-	"\xB8" => '&#248;',
-	"\xB9" => '&#185;',
-	"\xBA" => '&#343;',
-	"\xBB" => '&#187;',
-	"\xBC" => '&#188;',
-	"\xBD" => '&#189;',
-	"\xBE" => '&#190;',
-	"\xBF" => '&#230;',
-	"\xC0" => '&#260;',
-	"\xC1" => '&#302;',
-	"\xC2" => '&#256;',
-	"\xC3" => '&#262;',
-	"\xC4" => '&#196;',
-	"\xC5" => '&#197;',
-	"\xC6" => '&#280;',
-	"\xC7" => '&#274;',
-	"\xC8" => '&#268;',
-	"\xC9" => '&#201;',
-	"\xCA" => '&#377;',
-	"\xCB" => '&#278;',
-	"\xCC" => '&#290;',
-	"\xCD" => '&#310;',
-	"\xCE" => '&#298;',
-	"\xCF" => '&#315;',
-	"\xD0" => '&#352;',
-	"\xD1" => '&#323;',
-	"\xD2" => '&#325;',
-	"\xD3" => '&#211;',
-	"\xD4" => '&#332;',
-	"\xD5" => '&#213;',
-	"\xD6" => '&#214;',
-	"\xD7" => '&#215;',
-	"\xD8" => '&#370;',
-	"\xD9" => '&#321;',
-	"\xDA" => '&#346;',
-	"\xDB" => '&#362;',
-	"\xDC" => '&#220;',
-	"\xDD" => '&#379;',
-	"\xDE" => '&#381;',
-	"\xDF" => '&#223;',
-	"\xE0" => '&#261;',
-	"\xE1" => '&#303;',
-	"\xE2" => '&#257;',
-	"\xE3" => '&#263;',
-	"\xE4" => '&#228;',
-	"\xE5" => '&#229;',
-	"\xE6" => '&#281;',
-	"\xE7" => '&#275;',
-	"\xE8" => '&#269;',
-	"\xE9" => '&#233;',
-	"\xEA" => '&#378;',
-	"\xEB" => '&#279;',
-	"\xEC" => '&#291;',
-	"\xED" => '&#311;',
-	"\xEE" => '&#299;',
-	"\xEF" => '&#316;',
-	"\xF0" => '&#353;',
-	"\xF1" => '&#324;',
-	"\xF2" => '&#326;',
-	"\xF3" => '&#243;',
-	"\xF4" => '&#333;',
-	"\xF5" => '&#245;',
-	"\xF6" => '&#246;',
-	"\xF7" => '&#247;',
-	"\xF8" => '&#371;',
-	"\xF9" => '&#322;',
-	"\xFA" => '&#347;',
-	"\xFB" => '&#363;',
-	"\xFC" => '&#252;',
-	"\xFD" => '&#380;',
-	"\xFE" => '&#382;',
-	"\xFF" => '&#729;'
+        "\x80" => '&#8364;',
+        "\x82" => '&#8218;',
+        "\x84" => '&#8222;',
+        "\x85" => '&#8230;',
+        "\x86" => '&#8224;',
+        "\x87" => '&#8225;',
+        "\x89" => '&#8240;',
+        "\x8B" => '&#8249;',
+        "\x8D" => '&#168;',
+        "\x8E" => '&#711;',
+        "\x8F" => '&#184;',
+        "\x91" => '&#8216;',
+        "\x92" => '&#8217;',
+        "\x93" => '&#8220;',
+        "\x94" => '&#8221;',
+        "\x95" => '&#8226;',
+        "\x96" => '&#8211;',
+        "\x97" => '&#8212;',
+        "\x99" => '&#8482;',
+        "\x9B" => '&#8250;',
+        "\x9D" => '&#175;',
+        "\x9E" => '&#731;',
+        "\xA0" => '&#160;',
+        "\xA2" => '&#162;',
+        "\xA3" => '&#163;',
+        "\xA4" => '&#164;',
+        "\xA6" => '&#166;',
+        "\xA7" => '&#167;',
+        "\xA8" => '&#216;',
+        "\xA9" => '&#169;',
+        "\xAA" => '&#342;',
+        "\xAB" => '&#171;',
+        "\xAC" => '&#172;',
+        "\xAD" => '&#173;',
+        "\xAE" => '&#174;',
+        "\xAF" => '&#198;',
+        "\xB0" => '&#176;',
+        "\xB1" => '&#177;',
+        "\xB2" => '&#178;',
+        "\xB3" => '&#179;',
+        "\xB4" => '&#180;',
+        "\xB5" => '&#181;',
+        "\xB6" => '&#182;',
+        "\xB7" => '&#183;',
+        "\xB8" => '&#248;',
+        "\xB9" => '&#185;',
+        "\xBA" => '&#343;',
+        "\xBB" => '&#187;',
+        "\xBC" => '&#188;',
+        "\xBD" => '&#189;',
+        "\xBE" => '&#190;',
+        "\xBF" => '&#230;',
+        "\xC0" => '&#260;',
+        "\xC1" => '&#302;',
+        "\xC2" => '&#256;',
+        "\xC3" => '&#262;',
+        "\xC4" => '&#196;',
+        "\xC5" => '&#197;',
+        "\xC6" => '&#280;',
+        "\xC7" => '&#274;',
+        "\xC8" => '&#268;',
+        "\xC9" => '&#201;',
+        "\xCA" => '&#377;',
+        "\xCB" => '&#278;',
+        "\xCC" => '&#290;',
+        "\xCD" => '&#310;',
+        "\xCE" => '&#298;',
+        "\xCF" => '&#315;',
+        "\xD0" => '&#352;',
+        "\xD1" => '&#323;',
+        "\xD2" => '&#325;',
+        "\xD3" => '&#211;',
+        "\xD4" => '&#332;',
+        "\xD5" => '&#213;',
+        "\xD6" => '&#214;',
+        "\xD7" => '&#215;',
+        "\xD8" => '&#370;',
+        "\xD9" => '&#321;',
+        "\xDA" => '&#346;',
+        "\xDB" => '&#362;',
+        "\xDC" => '&#220;',
+        "\xDD" => '&#379;',
+        "\xDE" => '&#381;',
+        "\xDF" => '&#223;',
+        "\xE0" => '&#261;',
+        "\xE1" => '&#303;',
+        "\xE2" => '&#257;',
+        "\xE3" => '&#263;',
+        "\xE4" => '&#228;',
+        "\xE5" => '&#229;',
+        "\xE6" => '&#281;',
+        "\xE7" => '&#275;',
+        "\xE8" => '&#269;',
+        "\xE9" => '&#233;',
+        "\xEA" => '&#378;',
+        "\xEB" => '&#279;',
+        "\xEC" => '&#291;',
+        "\xED" => '&#311;',
+        "\xEE" => '&#299;',
+        "\xEF" => '&#316;',
+        "\xF0" => '&#353;',
+        "\xF1" => '&#324;',
+        "\xF2" => '&#326;',
+        "\xF3" => '&#243;',
+        "\xF4" => '&#333;',
+        "\xF5" => '&#245;',
+        "\xF6" => '&#246;',
+        "\xF7" => '&#247;',
+        "\xF8" => '&#371;',
+        "\xF9" => '&#322;',
+        "\xFA" => '&#347;',
+        "\xFB" => '&#363;',
+        "\xFC" => '&#252;',
+        "\xFD" => '&#380;',
+        "\xFE" => '&#382;',
+        "\xFF" => '&#729;'
     );
 
     $string = str_replace(array_keys($cp1257), array_values($cp1257), $string);
@@ -162,4 +162,4 @@ function charset_decode_cp1257 ($string) {
     return $string;
 }
 
-?>
+?>

+ 130 - 130
functions/decode/cp1258.php

@@ -7,7 +7,7 @@
  *
  * This file contains cp1258 decoding function that is needed to read
  * cp1258 encoded mails in non-cp1258 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.TXT
  *
@@ -39,134 +39,134 @@ function charset_decode_cp1258 ($string) {
         return $string;
 
     $cp1258 = array(
-	"\x80" => '&#8364;',
-	"\x81" => '&#65533;',
-	"\x82" => '&#8218;',
-	"\x83" => '&#402;',
-	"\x84" => '&#8222;',
-	"\x85" => '&#8230;',
-	"\x86" => '&#8224;',
-	"\x87" => '&#8225;',
-	"\x88" => '&#710;',
-	"\x89" => '&#8240;',
-	"\x8A" => '&#65533;',
-	"\x8B" => '&#8249;',
-	"\x8C" => '&#338;',
-	"\x8D" => '&#65533;',
-	"\x8E" => '&#65533;',
-	"\x8F" => '&#65533;',
-	"\x90" => '&#65533;',
-	"\x91" => '&#8216;',
-	"\x92" => '&#8217;',
-	"\x93" => '&#8220;',
-	"\x94" => '&#8221;',
-	"\x95" => '&#8226;',
-	"\x96" => '&#8211;',
-	"\x97" => '&#8212;',
-	"\x98" => '&#732;',
-	"\x99" => '&#8482;',
-	"\x9A" => '&#65533;',
-	"\x9B" => '&#8250;',
-	"\x9C" => '&#339;',
-	"\x9D" => '&#65533;',
-	"\x9E" => '&#65533;',
-	"\x9F" => '&#376;',
-	"\xA0" => '&#160;',
-	"\xA1" => '&#161;',
-	"\xA2" => '&#162;',
-	"\xA3" => '&#163;',
-	"\xA4" => '&#164;',
-	"\xA5" => '&#165;',
-	"\xA6" => '&#166;',
-	"\xA7" => '&#167;',
-	"\xA8" => '&#168;',
-	"\xA9" => '&#169;',
-	"\xAA" => '&#170;',
-	"\xAB" => '&#171;',
-	"\xAC" => '&#172;',
-	"\xAD" => '&#173;',
-	"\xAE" => '&#174;',
-	"\xAF" => '&#175;',
-	"\xB0" => '&#176;',
-	"\xB1" => '&#177;',
-	"\xB2" => '&#178;',
-	"\xB3" => '&#179;',
-	"\xB4" => '&#180;',
-	"\xB5" => '&#181;',
-	"\xB6" => '&#182;',
-	"\xB7" => '&#183;',
-	"\xB8" => '&#184;',
-	"\xB9" => '&#185;',
-	"\xBA" => '&#186;',
-	"\xBB" => '&#187;',
-	"\xBC" => '&#188;',
-	"\xBD" => '&#189;',
-	"\xBE" => '&#190;',
-	"\xBF" => '&#191;',
-	"\xC0" => '&#192;',
-	"\xC1" => '&#193;',
-	"\xC2" => '&#194;',
-	"\xC3" => '&#258;',
-	"\xC4" => '&#196;',
-	"\xC5" => '&#197;',
-	"\xC6" => '&#198;',
-	"\xC7" => '&#199;',
-	"\xC8" => '&#200;',
-	"\xC9" => '&#201;',
-	"\xCA" => '&#202;',
-	"\xCB" => '&#203;',
-	"\xCC" => '&#768;',
-	"\xCD" => '&#205;',
-	"\xCE" => '&#206;',
-	"\xCF" => '&#207;',
-	"\xD0" => '&#272;',
-	"\xD1" => '&#209;',
-	"\xD2" => '&#777;',
-	"\xD3" => '&#211;',
-	"\xD4" => '&#212;',
-	"\xD5" => '&#416;',
-	"\xD6" => '&#214;',
-	"\xD7" => '&#215;',
-	"\xD8" => '&#216;',
-	"\xD9" => '&#217;',
-	"\xDA" => '&#218;',
-	"\xDB" => '&#219;',
-	"\xDC" => '&#220;',
-	"\xDD" => '&#431;',
-	"\xDE" => '&#771;',
-	"\xDF" => '&#223;',
-	"\xE0" => '&#224;',
-	"\xE1" => '&#225;',
-	"\xE2" => '&#226;',
-	"\xE3" => '&#259;',
-	"\xE4" => '&#228;',
-	"\xE5" => '&#229;',
-	"\xE6" => '&#230;',
-	"\xE7" => '&#231;',
-	"\xE8" => '&#232;',
-	"\xE9" => '&#233;',
-	"\xEA" => '&#234;',
-	"\xEB" => '&#235;',
-	"\xEC" => '&#769;',
-	"\xED" => '&#237;',
-	"\xEE" => '&#238;',
-	"\xEF" => '&#239;',
-	"\xF0" => '&#273;',
-	"\xF1" => '&#241;',
-	"\xF2" => '&#803;',
-	"\xF3" => '&#243;',
-	"\xF4" => '&#244;',
-	"\xF5" => '&#417;',
-	"\xF6" => '&#246;',
-	"\xF7" => '&#247;',
-	"\xF8" => '&#248;',
-	"\xF9" => '&#249;',
-	"\xFA" => '&#250;',
-	"\xFB" => '&#251;',
-	"\xFC" => '&#252;',
-	"\xFD" => '&#432;',
-	"\xFE" => '&#8363;',
-	"\xFF" => '&#255;'
+        "\x80" => '&#8364;',
+        "\x81" => '&#65533;',
+        "\x82" => '&#8218;',
+        "\x83" => '&#402;',
+        "\x84" => '&#8222;',
+        "\x85" => '&#8230;',
+        "\x86" => '&#8224;',
+        "\x87" => '&#8225;',
+        "\x88" => '&#710;',
+        "\x89" => '&#8240;',
+        "\x8A" => '&#65533;',
+        "\x8B" => '&#8249;',
+        "\x8C" => '&#338;',
+        "\x8D" => '&#65533;',
+        "\x8E" => '&#65533;',
+        "\x8F" => '&#65533;',
+        "\x90" => '&#65533;',
+        "\x91" => '&#8216;',
+        "\x92" => '&#8217;',
+        "\x93" => '&#8220;',
+        "\x94" => '&#8221;',
+        "\x95" => '&#8226;',
+        "\x96" => '&#8211;',
+        "\x97" => '&#8212;',
+        "\x98" => '&#732;',
+        "\x99" => '&#8482;',
+        "\x9A" => '&#65533;',
+        "\x9B" => '&#8250;',
+        "\x9C" => '&#339;',
+        "\x9D" => '&#65533;',
+        "\x9E" => '&#65533;',
+        "\x9F" => '&#376;',
+        "\xA0" => '&#160;',
+        "\xA1" => '&#161;',
+        "\xA2" => '&#162;',
+        "\xA3" => '&#163;',
+        "\xA4" => '&#164;',
+        "\xA5" => '&#165;',
+        "\xA6" => '&#166;',
+        "\xA7" => '&#167;',
+        "\xA8" => '&#168;',
+        "\xA9" => '&#169;',
+        "\xAA" => '&#170;',
+        "\xAB" => '&#171;',
+        "\xAC" => '&#172;',
+        "\xAD" => '&#173;',
+        "\xAE" => '&#174;',
+        "\xAF" => '&#175;',
+        "\xB0" => '&#176;',
+        "\xB1" => '&#177;',
+        "\xB2" => '&#178;',
+        "\xB3" => '&#179;',
+        "\xB4" => '&#180;',
+        "\xB5" => '&#181;',
+        "\xB6" => '&#182;',
+        "\xB7" => '&#183;',
+        "\xB8" => '&#184;',
+        "\xB9" => '&#185;',
+        "\xBA" => '&#186;',
+        "\xBB" => '&#187;',
+        "\xBC" => '&#188;',
+        "\xBD" => '&#189;',
+        "\xBE" => '&#190;',
+        "\xBF" => '&#191;',
+        "\xC0" => '&#192;',
+        "\xC1" => '&#193;',
+        "\xC2" => '&#194;',
+        "\xC3" => '&#258;',
+        "\xC4" => '&#196;',
+        "\xC5" => '&#197;',
+        "\xC6" => '&#198;',
+        "\xC7" => '&#199;',
+        "\xC8" => '&#200;',
+        "\xC9" => '&#201;',
+        "\xCA" => '&#202;',
+        "\xCB" => '&#203;',
+        "\xCC" => '&#768;',
+        "\xCD" => '&#205;',
+        "\xCE" => '&#206;',
+        "\xCF" => '&#207;',
+        "\xD0" => '&#272;',
+        "\xD1" => '&#209;',
+        "\xD2" => '&#777;',
+        "\xD3" => '&#211;',
+        "\xD4" => '&#212;',
+        "\xD5" => '&#416;',
+        "\xD6" => '&#214;',
+        "\xD7" => '&#215;',
+        "\xD8" => '&#216;',
+        "\xD9" => '&#217;',
+        "\xDA" => '&#218;',
+        "\xDB" => '&#219;',
+        "\xDC" => '&#220;',
+        "\xDD" => '&#431;',
+        "\xDE" => '&#771;',
+        "\xDF" => '&#223;',
+        "\xE0" => '&#224;',
+        "\xE1" => '&#225;',
+        "\xE2" => '&#226;',
+        "\xE3" => '&#259;',
+        "\xE4" => '&#228;',
+        "\xE5" => '&#229;',
+        "\xE6" => '&#230;',
+        "\xE7" => '&#231;',
+        "\xE8" => '&#232;',
+        "\xE9" => '&#233;',
+        "\xEA" => '&#234;',
+        "\xEB" => '&#235;',
+        "\xEC" => '&#769;',
+        "\xED" => '&#237;',
+        "\xEE" => '&#238;',
+        "\xEF" => '&#239;',
+        "\xF0" => '&#273;',
+        "\xF1" => '&#241;',
+        "\xF2" => '&#803;',
+        "\xF3" => '&#243;',
+        "\xF4" => '&#244;',
+        "\xF5" => '&#417;',
+        "\xF6" => '&#246;',
+        "\xF7" => '&#247;',
+        "\xF8" => '&#248;',
+        "\xF9" => '&#249;',
+        "\xFA" => '&#250;',
+        "\xFB" => '&#251;',
+        "\xFC" => '&#252;',
+        "\xFD" => '&#432;',
+        "\xFE" => '&#8363;',
+        "\xFF" => '&#255;'
     );
 
     $string = str_replace(array_keys($cp1258), array_values($cp1258), $string);
@@ -174,4 +174,4 @@ function charset_decode_cp1258 ($string) {
     return $string;
 }
 
-?>
+?>

+ 131 - 131
functions/decode/cp855.php

@@ -7,7 +7,7 @@
  *
  * This file contains cp855 decoding function that is needed to read
  * cp855 encoded mails in non-cp855 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP855.TXT
  *   Name:     cp855_DOSCyrillic to Unicode table
@@ -17,7 +17,7 @@
  *   Date:          04/24/96
  *   Authors:       Lori Brownell <loribr@microsoft.com>
  *                  K.D. Chang    <a-kchang@microsoft.com>
- * 
+ *
  * @version $Id$
  * @package squirrelmail
  * @subpackage decode
@@ -39,134 +39,134 @@ function charset_decode_cp855 ($string) {
         return $string;
 
     $cp855 = array(
-	"\x80" => '&#1106;',
-	"\x81" => '&#1026;',
-	"\x82" => '&#1107;',
-	"\x83" => '&#1027;',
-	"\x84" => '&#1105;',
-	"\x85" => '&#1025;',
-	"\x86" => '&#1108;',
-	"\x87" => '&#1028;',
-	"\x88" => '&#1109;',
-	"\x89" => '&#1029;',
-	"\x8a" => '&#1110;',
-	"\x8b" => '&#1030;',
-	"\x8c" => '&#1111;',
-	"\x8d" => '&#1031;',
-	"\x8e" => '&#1112;',
-	"\x8f" => '&#1032;',
-	"\x90" => '&#1113;',
-	"\x91" => '&#1033;',
-	"\x92" => '&#1114;',
-	"\x93" => '&#1034;',
-	"\x94" => '&#1115;',
-	"\x95" => '&#1035;',
-	"\x96" => '&#1116;',
-	"\x97" => '&#1036;',
-	"\x98" => '&#1118;',
-	"\x99" => '&#1038;',
-	"\x9a" => '&#1119;',
-	"\x9b" => '&#1039;',
-	"\x9c" => '&#1102;',
-	"\x9d" => '&#1070;',
-	"\x9e" => '&#1098;',
-	"\x9f" => '&#1066;',
-	"\xa0" => '&#1072;',
-	"\xa1" => '&#1040;',
-	"\xa2" => '&#1073;',
-	"\xa3" => '&#1041;',
-	"\xa4" => '&#1094;',
-	"\xa5" => '&#1062;',
-	"\xa6" => '&#1076;',
-	"\xa7" => '&#1044;',
-	"\xa8" => '&#1077;',
-	"\xa9" => '&#1045;',
-	"\xaa" => '&#1092;',
-	"\xab" => '&#1060;',
-	"\xac" => '&#1075;',
-	"\xad" => '&#1043;',
-	"\xae" => '&#171;',
-	"\xaf" => '&#187;',
-	"\xb0" => '&#9617;',
-	"\xb1" => '&#9618;',
-	"\xb2" => '&#9619;',
-	"\xb3" => '&#9474;',
-	"\xb4" => '&#9508;',
-	"\xb5" => '&#1093;',
-	"\xb6" => '&#1061;',
-	"\xb7" => '&#1080;',
-	"\xb8" => '&#1048;',
-	"\xb9" => '&#9571;',
-	"\xba" => '&#9553;',
-	"\xbb" => '&#9559;',
-	"\xbc" => '&#9565;',
-	"\xbd" => '&#1081;',
-	"\xbe" => '&#1049;',
-	"\xbf" => '&#9488;',
-	"\xc0" => '&#9492;',
-	"\xc1" => '&#9524;',
-	"\xc2" => '&#9516;',
-	"\xc3" => '&#9500;',
-	"\xc4" => '&#9472;',
-	"\xc5" => '&#9532;',
-	"\xc6" => '&#1082;',
-	"\xc7" => '&#1050;',
-	"\xc8" => '&#9562;',
-	"\xc9" => '&#9556;',
-	"\xca" => '&#9577;',
-	"\xcb" => '&#9574;',
-	"\xcc" => '&#9568;',
-	"\xcd" => '&#9552;',
-	"\xce" => '&#9580;',
-	"\xcf" => '&#164;',
-	"\xd0" => '&#1083;',
-	"\xd1" => '&#1051;',
-	"\xd2" => '&#1084;',
-	"\xd3" => '&#1052;',
-	"\xd4" => '&#1085;',
-	"\xd5" => '&#1053;',
-	"\xd6" => '&#1086;',
-	"\xd7" => '&#1054;',
-	"\xd8" => '&#1087;',
-	"\xd9" => '&#9496;',
-	"\xda" => '&#9484;',
-	"\xdb" => '&#9608;',
-	"\xdc" => '&#9604;',
-	"\xdd" => '&#1055;',
-	"\xde" => '&#1103;',
-	"\xdf" => '&#9600;',
-	"\xe0" => '&#1071;',
-	"\xe1" => '&#1088;',
-	"\xe2" => '&#1056;',
-	"\xe3" => '&#1089;',
-	"\xe4" => '&#1057;',
-	"\xe5" => '&#1090;',
-	"\xe6" => '&#1058;',
-	"\xe7" => '&#1091;',
-	"\xe8" => '&#1059;',
-	"\xe9" => '&#1078;',
-	"\xea" => '&#1046;',
-	"\xeb" => '&#1074;',
-	"\xec" => '&#1042;',
-	"\xed" => '&#1100;',
-	"\xee" => '&#1068;',
-	"\xef" => '&#8470;',
-	"\xf0" => '&#173;',
-	"\xf1" => '&#1099;',
-	"\xf2" => '&#1067;',
-	"\xf3" => '&#1079;',
-	"\xf4" => '&#1047;',
-	"\xf5" => '&#1096;',
-	"\xf6" => '&#1064;',
-	"\xf7" => '&#1101;',
-	"\xf8" => '&#1069;',
-	"\xf9" => '&#1097;',
-	"\xfa" => '&#1065;',
-	"\xfb" => '&#1095;',
-	"\xfc" => '&#1063;',
-	"\xfd" => '&#167;',
-	"\xfe" => '&#9632;',
-	"\xff" => '&#160;'
+        "\x80" => '&#1106;',
+        "\x81" => '&#1026;',
+        "\x82" => '&#1107;',
+        "\x83" => '&#1027;',
+        "\x84" => '&#1105;',
+        "\x85" => '&#1025;',
+        "\x86" => '&#1108;',
+        "\x87" => '&#1028;',
+        "\x88" => '&#1109;',
+        "\x89" => '&#1029;',
+        "\x8a" => '&#1110;',
+        "\x8b" => '&#1030;',
+        "\x8c" => '&#1111;',
+        "\x8d" => '&#1031;',
+        "\x8e" => '&#1112;',
+        "\x8f" => '&#1032;',
+        "\x90" => '&#1113;',
+        "\x91" => '&#1033;',
+        "\x92" => '&#1114;',
+        "\x93" => '&#1034;',
+        "\x94" => '&#1115;',
+        "\x95" => '&#1035;',
+        "\x96" => '&#1116;',
+        "\x97" => '&#1036;',
+        "\x98" => '&#1118;',
+        "\x99" => '&#1038;',
+        "\x9a" => '&#1119;',
+        "\x9b" => '&#1039;',
+        "\x9c" => '&#1102;',
+        "\x9d" => '&#1070;',
+        "\x9e" => '&#1098;',
+        "\x9f" => '&#1066;',
+        "\xa0" => '&#1072;',
+        "\xa1" => '&#1040;',
+        "\xa2" => '&#1073;',
+        "\xa3" => '&#1041;',
+        "\xa4" => '&#1094;',
+        "\xa5" => '&#1062;',
+        "\xa6" => '&#1076;',
+        "\xa7" => '&#1044;',
+        "\xa8" => '&#1077;',
+        "\xa9" => '&#1045;',
+        "\xaa" => '&#1092;',
+        "\xab" => '&#1060;',
+        "\xac" => '&#1075;',
+        "\xad" => '&#1043;',
+        "\xae" => '&#171;',
+        "\xaf" => '&#187;',
+        "\xb0" => '&#9617;',
+        "\xb1" => '&#9618;',
+        "\xb2" => '&#9619;',
+        "\xb3" => '&#9474;',
+        "\xb4" => '&#9508;',
+        "\xb5" => '&#1093;',
+        "\xb6" => '&#1061;',
+        "\xb7" => '&#1080;',
+        "\xb8" => '&#1048;',
+        "\xb9" => '&#9571;',
+        "\xba" => '&#9553;',
+        "\xbb" => '&#9559;',
+        "\xbc" => '&#9565;',
+        "\xbd" => '&#1081;',
+        "\xbe" => '&#1049;',
+        "\xbf" => '&#9488;',
+        "\xc0" => '&#9492;',
+        "\xc1" => '&#9524;',
+        "\xc2" => '&#9516;',
+        "\xc3" => '&#9500;',
+        "\xc4" => '&#9472;',
+        "\xc5" => '&#9532;',
+        "\xc6" => '&#1082;',
+        "\xc7" => '&#1050;',
+        "\xc8" => '&#9562;',
+        "\xc9" => '&#9556;',
+        "\xca" => '&#9577;',
+        "\xcb" => '&#9574;',
+        "\xcc" => '&#9568;',
+        "\xcd" => '&#9552;',
+        "\xce" => '&#9580;',
+        "\xcf" => '&#164;',
+        "\xd0" => '&#1083;',
+        "\xd1" => '&#1051;',
+        "\xd2" => '&#1084;',
+        "\xd3" => '&#1052;',
+        "\xd4" => '&#1085;',
+        "\xd5" => '&#1053;',
+        "\xd6" => '&#1086;',
+        "\xd7" => '&#1054;',
+        "\xd8" => '&#1087;',
+        "\xd9" => '&#9496;',
+        "\xda" => '&#9484;',
+        "\xdb" => '&#9608;',
+        "\xdc" => '&#9604;',
+        "\xdd" => '&#1055;',
+        "\xde" => '&#1103;',
+        "\xdf" => '&#9600;',
+        "\xe0" => '&#1071;',
+        "\xe1" => '&#1088;',
+        "\xe2" => '&#1056;',
+        "\xe3" => '&#1089;',
+        "\xe4" => '&#1057;',
+        "\xe5" => '&#1090;',
+        "\xe6" => '&#1058;',
+        "\xe7" => '&#1091;',
+        "\xe8" => '&#1059;',
+        "\xe9" => '&#1078;',
+        "\xea" => '&#1046;',
+        "\xeb" => '&#1074;',
+        "\xec" => '&#1042;',
+        "\xed" => '&#1100;',
+        "\xee" => '&#1068;',
+        "\xef" => '&#8470;',
+        "\xf0" => '&#173;',
+        "\xf1" => '&#1099;',
+        "\xf2" => '&#1067;',
+        "\xf3" => '&#1079;',
+        "\xf4" => '&#1047;',
+        "\xf5" => '&#1096;',
+        "\xf6" => '&#1064;',
+        "\xf7" => '&#1101;',
+        "\xf8" => '&#1069;',
+        "\xf9" => '&#1097;',
+        "\xfa" => '&#1065;',
+        "\xfb" => '&#1095;',
+        "\xfc" => '&#1063;',
+        "\xfd" => '&#167;',
+        "\xfe" => '&#9632;',
+        "\xff" => '&#160;'
     );
 
     $string = str_replace(array_keys($cp855), array_values($cp855), $string);
@@ -174,4 +174,4 @@ function charset_decode_cp855 ($string) {
     return $string;
 }
 
-?>
+?>

+ 131 - 131
functions/decode/cp866.php

@@ -7,7 +7,7 @@
  *
  * This file contains cp866 decoding function that is needed to read
  * cp866 encoded mails in non-cp866 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/
 
@@ -19,7 +19,7 @@
     Authors:       Lori Brownell <loribr@microsoft.com>
                    K.D. Chang    <a-kchang@microsoft.com>
     The entries are in cp866_DOSCyrillicRussian order
- * 
+ *
  * @version $Id$
  * @package squirrelmail
  * @subpackage decode
@@ -41,137 +41,137 @@ function charset_decode_cp866 ($string) {
         return $string;
 
     $cp866 = array(
-	"\x80" => '&#1040;',
-	"\x81" => '&#1041;',
-	"\x82" => '&#1042;',
-	"\x83" => '&#1043;',
-	"\x84" => '&#1044;',
-	"\x85" => '&#1045;',
-	"\x86" => '&#1046;',
-	"\x87" => '&#1047;',
-	"\x88" => '&#1048;',
-	"\x89" => '&#1049;',
-	"\x8a" => '&#1050;',
-	"\x8b" => '&#1051;',
-	"\x8c" => '&#1052;',
-	"\x8d" => '&#1053;',
-	"\x8e" => '&#1054;',
-	"\x8f" => '&#1055;',
-	"\x90" => '&#1056;',
-	"\x91" => '&#1057;',
-	"\x92" => '&#1058;',
-	"\x93" => '&#1059;',
-	"\x94" => '&#1060;',
-	"\x95" => '&#1061;',
-	"\x96" => '&#1062;',
-	"\x97" => '&#1063;',
-	"\x98" => '&#1064;',
-	"\x99" => '&#1065;',
-	"\x9a" => '&#1066;',
-	"\x9b" => '&#1067;',
-	"\x9c" => '&#1068;',
-	"\x9d" => '&#1069;',
-	"\x9e" => '&#1070;',
-	"\x9f" => '&#1071;',
-	"\xa0" => '&#1072;',
-	"\xa1" => '&#1073;',
-	"\xa2" => '&#1074;',
-	"\xa3" => '&#1075;',
-	"\xa4" => '&#1076;',
-	"\xa5" => '&#1077;',
-	"\xa6" => '&#1078;',
-	"\xa7" => '&#1079;',
-	"\xa8" => '&#1080;',
-	"\xa9" => '&#1081;',
-	"\xaa" => '&#1082;',
-	"\xab" => '&#1083;',
-	"\xac" => '&#1084;',
-	"\xad" => '&#1085;',
-	"\xae" => '&#1086;',
-	"\xaf" => '&#1087;',
-	"\xb0" => '&#9617;',
-	"\xb1" => '&#9618;',
-	"\xb2" => '&#9619;',
-	"\xb3" => '&#9474;',
-	"\xb4" => '&#9508;',
-	"\xb5" => '&#9569;',
-	"\xb6" => '&#9570;',
-	"\xb7" => '&#9558;',
-	"\xb8" => '&#9557;',
-	"\xb9" => '&#9571;',
-	"\xba" => '&#9553;',
-	"\xbb" => '&#9559;',
-	"\xbc" => '&#9565;',
-	"\xbd" => '&#9564;',
-	"\xbe" => '&#9563;',
-	"\xbf" => '&#9488;',
-	"\xc0" => '&#9492;',
-	"\xc1" => '&#9524;',
-	"\xc2" => '&#9516;',
-	"\xc3" => '&#9500;',
-	"\xc4" => '&#9472;',
-	"\xc5" => '&#9532;',
-	"\xc6" => '&#9566;',
-	"\xc7" => '&#9567;',
-	"\xc8" => '&#9562;',
-	"\xc9" => '&#9556;',
-	"\xca" => '&#9577;',
-	"\xcb" => '&#9574;',
-	"\xcc" => '&#9568;',
-	"\xcd" => '&#9552;',
-	"\xce" => '&#9580;',
-	"\xcf" => '&#9575;',
-	"\xd0" => '&#9576;',
-	"\xd1" => '&#9572;',
-	"\xd2" => '&#9573;',
-	"\xd3" => '&#9561;',
-	"\xd4" => '&#9560;',
-	"\xd5" => '&#9554;',
-	"\xd6" => '&#9555;',
-	"\xd7" => '&#9579;',
-	"\xd8" => '&#9578;',
-	"\xd9" => '&#9496;',
-	"\xda" => '&#9484;',
-	"\xdb" => '&#9608;',
-	"\xdc" => '&#9604;',
-	"\xdd" => '&#9612;',
-	"\xde" => '&#9616;',
-	"\xdf" => '&#9600;',
-	"\xe0" => '&#1088;',
-	"\xe1" => '&#1089;',
-	"\xe2" => '&#1090;',
-	"\xe3" => '&#1091;',
-	"\xe4" => '&#1092;',
-	"\xe5" => '&#1093;',
-	"\xe6" => '&#1094;',
-	"\xe7" => '&#1095;',
-	"\xe8" => '&#1096;',
-	"\xe9" => '&#1097;',
-	"\xea" => '&#1098;',
-	"\xeb" => '&#1099;',
-	"\xec" => '&#1100;',
-	"\xed" => '&#1101;',
-	"\xee" => '&#1102;',
-	"\xef" => '&#1103;',
-	"\xf0" => '&#1025;',
-	"\xf1" => '&#1105;',
-	"\xf2" => '&#1028;',
-	"\xf3" => '&#1108;',
-	"\xf4" => '&#1031;',
-	"\xf5" => '&#1111;',
-	"\xf6" => '&#1038;',
-	"\xf7" => '&#1118;',
-	"\xf8" => '&#176;',
-	"\xf9" => '&#8729;',
-	"\xfa" => '&#183;',
-	"\xfb" => '&#8730;',
-	"\xfc" => '&#8470;',
-	"\xfd" => '&#164;',
-	"\xfe" => '&#9632;',
-	"\xff" => '&#160;'
+        "\x80" => '&#1040;',
+        "\x81" => '&#1041;',
+        "\x82" => '&#1042;',
+        "\x83" => '&#1043;',
+        "\x84" => '&#1044;',
+        "\x85" => '&#1045;',
+        "\x86" => '&#1046;',
+        "\x87" => '&#1047;',
+        "\x88" => '&#1048;',
+        "\x89" => '&#1049;',
+        "\x8a" => '&#1050;',
+        "\x8b" => '&#1051;',
+        "\x8c" => '&#1052;',
+        "\x8d" => '&#1053;',
+        "\x8e" => '&#1054;',
+        "\x8f" => '&#1055;',
+        "\x90" => '&#1056;',
+        "\x91" => '&#1057;',
+        "\x92" => '&#1058;',
+        "\x93" => '&#1059;',
+        "\x94" => '&#1060;',
+        "\x95" => '&#1061;',
+        "\x96" => '&#1062;',
+        "\x97" => '&#1063;',
+        "\x98" => '&#1064;',
+        "\x99" => '&#1065;',
+        "\x9a" => '&#1066;',
+        "\x9b" => '&#1067;',
+        "\x9c" => '&#1068;',
+        "\x9d" => '&#1069;',
+        "\x9e" => '&#1070;',
+        "\x9f" => '&#1071;',
+        "\xa0" => '&#1072;',
+        "\xa1" => '&#1073;',
+        "\xa2" => '&#1074;',
+        "\xa3" => '&#1075;',
+        "\xa4" => '&#1076;',
+        "\xa5" => '&#1077;',
+        "\xa6" => '&#1078;',
+        "\xa7" => '&#1079;',
+        "\xa8" => '&#1080;',
+        "\xa9" => '&#1081;',
+        "\xaa" => '&#1082;',
+        "\xab" => '&#1083;',
+        "\xac" => '&#1084;',
+        "\xad" => '&#1085;',
+        "\xae" => '&#1086;',
+        "\xaf" => '&#1087;',
+        "\xb0" => '&#9617;',
+        "\xb1" => '&#9618;',
+        "\xb2" => '&#9619;',
+        "\xb3" => '&#9474;',
+        "\xb4" => '&#9508;',
+        "\xb5" => '&#9569;',
+        "\xb6" => '&#9570;',
+        "\xb7" => '&#9558;',
+        "\xb8" => '&#9557;',
+        "\xb9" => '&#9571;',
+        "\xba" => '&#9553;',
+        "\xbb" => '&#9559;',
+        "\xbc" => '&#9565;',
+        "\xbd" => '&#9564;',
+        "\xbe" => '&#9563;',
+        "\xbf" => '&#9488;',
+        "\xc0" => '&#9492;',
+        "\xc1" => '&#9524;',
+        "\xc2" => '&#9516;',
+        "\xc3" => '&#9500;',
+        "\xc4" => '&#9472;',
+        "\xc5" => '&#9532;',
+        "\xc6" => '&#9566;',
+        "\xc7" => '&#9567;',
+        "\xc8" => '&#9562;',
+        "\xc9" => '&#9556;',
+        "\xca" => '&#9577;',
+        "\xcb" => '&#9574;',
+        "\xcc" => '&#9568;',
+        "\xcd" => '&#9552;',
+        "\xce" => '&#9580;',
+        "\xcf" => '&#9575;',
+        "\xd0" => '&#9576;',
+        "\xd1" => '&#9572;',
+        "\xd2" => '&#9573;',
+        "\xd3" => '&#9561;',
+        "\xd4" => '&#9560;',
+        "\xd5" => '&#9554;',
+        "\xd6" => '&#9555;',
+        "\xd7" => '&#9579;',
+        "\xd8" => '&#9578;',
+        "\xd9" => '&#9496;',
+        "\xda" => '&#9484;',
+        "\xdb" => '&#9608;',
+        "\xdc" => '&#9604;',
+        "\xdd" => '&#9612;',
+        "\xde" => '&#9616;',
+        "\xdf" => '&#9600;',
+        "\xe0" => '&#1088;',
+        "\xe1" => '&#1089;',
+        "\xe2" => '&#1090;',
+        "\xe3" => '&#1091;',
+        "\xe4" => '&#1092;',
+        "\xe5" => '&#1093;',
+        "\xe6" => '&#1094;',
+        "\xe7" => '&#1095;',
+        "\xe8" => '&#1096;',
+        "\xe9" => '&#1097;',
+        "\xea" => '&#1098;',
+        "\xeb" => '&#1099;',
+        "\xec" => '&#1100;',
+        "\xed" => '&#1101;',
+        "\xee" => '&#1102;',
+        "\xef" => '&#1103;',
+        "\xf0" => '&#1025;',
+        "\xf1" => '&#1105;',
+        "\xf2" => '&#1028;',
+        "\xf3" => '&#1108;',
+        "\xf4" => '&#1031;',
+        "\xf5" => '&#1111;',
+        "\xf6" => '&#1038;',
+        "\xf7" => '&#1118;',
+        "\xf8" => '&#176;',
+        "\xf9" => '&#8729;',
+        "\xfa" => '&#183;',
+        "\xfb" => '&#8730;',
+        "\xfc" => '&#8470;',
+        "\xfd" => '&#164;',
+        "\xfe" => '&#9632;',
+        "\xff" => '&#160;'
     );
 
     $string = str_replace(array_keys($cp866), array_values($cp866), $string);
 
     return $string;
-}
+}

+ 1 - 1
functions/decode/iso_8859_10.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-10 decoding function that is needed to read
  * iso-8859-10 encoded mails in non-iso-8859-10 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-10.TXT
  *

+ 110 - 110
functions/decode/iso_8859_11.php

@@ -7,33 +7,33 @@
  *
  * This file contains iso-8859-11 decoding function that is needed to read
  * iso-8859-11 encoded mails in non-iso-8859-11 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-11.TXT
  *
- *	Name:             ISO/IEC 8859-11:2001 to Unicode
- *	Unicode version:  3.2
- *	Table version:    1.0
- *	Table format:     Format A
- *	Date:             2002 October 7
- *	Authors:          Ken Whistler <kenw@sybase.com>
+ *        Name:             ISO/IEC 8859-11:2001 to Unicode
+ *        Unicode version:  3.2
+ *        Table version:    1.0
+ *        Table format:     Format A
+ *        Date:             2002 October 7
+ *        Authors:          Ken Whistler <kenw@sybase.com>
  *
  * Original copyright:
- *	Copyright (c) 1999 Unicode, Inc.  All Rights reserved.
+ *        Copyright (c) 1999 Unicode, Inc.  All Rights reserved.
  *
- *	This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
- *	No claims are made as to fitness for any particular purpose.  No
- *	warranties of any kind are expressed or implied.  The recipient
- *	agrees to determine applicability of information provided.  If this
- *	file has been provided on optical media by Unicode, Inc., the sole
- *	remedy for any claim will be exchange of defective media within 90
- *	days of receipt.
+ *        This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
+ *        No claims are made as to fitness for any particular purpose.  No
+ *        warranties of any kind are expressed or implied.  The recipient
+ *        agrees to determine applicability of information provided.  If this
+ *        file has been provided on optical media by Unicode, Inc., the sole
+ *        remedy for any claim will be exchange of defective media within 90
+ *        days of receipt.
  *
- *	Unicode, Inc. hereby grants the right to freely use the information
- *	supplied in this file in the creation of products supporting the
- *	Unicode Standard, and to make copies of this file in any form for
- *	internal or external distribution as long as this notice remains
- *	attached.
+ *        Unicode, Inc. hereby grants the right to freely use the information
+ *        supplied in this file in the creation of products supporting the
+ *        Unicode Standard, and to make copies of this file in any form for
+ *        internal or external distribution as long as this notice remains
+ *        attached.
  *
  * @version $Id$
  * @package squirrelmail
@@ -43,7 +43,7 @@
 /**
  * Decode iso8859-11 string
  * @param string $string Encoded string
- * @return string $string Decoded string 
+ * @return string $string Decoded string
  */
 function charset_decode_iso_8859_11 ($string) {
     global $default_charset;
@@ -56,94 +56,94 @@ function charset_decode_iso_8859_11 ($string) {
         return $string;
 
     $iso8859_11 = array(
-	"\xA0" => '&#160;',
-	"\xA1" => '&#3585;',
-	"\xA2" => '&#3586;',
-	"\xA3" => '&#3587;',
-	"\xA4" => '&#3588;',
-	"\xA5" => '&#3589;',
-	"\xA6" => '&#3590;',
-	"\xA7" => '&#3591;',
-	"\xA8" => '&#3592;',
-	"\xA9" => '&#3593;',
-	"\xAA" => '&#3594;',
-	"\xAB" => '&#3595;',
-	"\xAC" => '&#3596;',
-	"\xAD" => '&#3597;',
-	"\xAE" => '&#3598;',
-	"\xAF" => '&#3599;',
-	"\xB0" => '&#3600;',
-	"\xB1" => '&#3601;',
-	"\xB2" => '&#3602;',
-	"\xB3" => '&#3603;',
-	"\xB4" => '&#3604;',
-	"\xB5" => '&#3605;',
-	"\xB6" => '&#3606;',
-	"\xB7" => '&#3607;',
-	"\xB8" => '&#3608;',
-	"\xB9" => '&#3609;',
-	"\xBA" => '&#3610;',
-	"\xBB" => '&#3611;',
-	"\xBC" => '&#3612;',
-	"\xBD" => '&#3613;',
-	"\xBE" => '&#3614;',
-	"\xBF" => '&#3615;',
-	"\xC0" => '&#3616;',
-	"\xC1" => '&#3617;',
-	"\xC2" => '&#3618;',
-	"\xC3" => '&#3619;',
-	"\xC4" => '&#3620;',
-	"\xC5" => '&#3621;',
-	"\xC6" => '&#3622;',
-	"\xC7" => '&#3623;',
-	"\xC8" => '&#3624;',
-	"\xC9" => '&#3625;',
-	"\xCA" => '&#3626;',
-	"\xCB" => '&#3627;',
-	"\xCC" => '&#3628;',
-	"\xCD" => '&#3629;',
-	"\xCE" => '&#3630;',
-	"\xCF" => '&#3631;',
-	"\xD0" => '&#3632;',
-	"\xD1" => '&#3633;',
-	"\xD2" => '&#3634;',
-	"\xD3" => '&#3635;',
-	"\xD4" => '&#3636;',
-	"\xD5" => '&#3637;',
-	"\xD6" => '&#3638;',
-	"\xD7" => '&#3639;',
-	"\xD8" => '&#3640;',
-	"\xD9" => '&#3641;',
-	"\xDA" => '&#3642;',
-	"\xDF" => '&#3647;',
-	"\xE0" => '&#3648;',
-	"\xE1" => '&#3649;',
-	"\xE2" => '&#3650;',
-	"\xE3" => '&#3651;',
-	"\xE4" => '&#3652;',
-	"\xE5" => '&#3653;',
-	"\xE6" => '&#3654;',
-	"\xE7" => '&#3655;',
-	"\xE8" => '&#3656;',
-	"\xE9" => '&#3657;',
-	"\xEA" => '&#3658;',
-	"\xEB" => '&#3659;',
-	"\xEC" => '&#3660;',
-	"\xED" => '&#3661;',
-	"\xEE" => '&#3662;',
-	"\xEF" => '&#3663;',
-	"\xF0" => '&#3664;',
-	"\xF1" => '&#3665;',
-	"\xF2" => '&#3666;',
-	"\xF3" => '&#3667;',
-	"\xF4" => '&#3668;',
-	"\xF5" => '&#3669;',
-	"\xF6" => '&#3670;',
-	"\xF7" => '&#3671;',
-	"\xF8" => '&#3672;',
-	"\xF9" => '&#3673;',
-	"\xFA" => '&#3674;',
-	"\xFB" => '&#3675;'
+        "\xA0" => '&#160;',
+        "\xA1" => '&#3585;',
+        "\xA2" => '&#3586;',
+        "\xA3" => '&#3587;',
+        "\xA4" => '&#3588;',
+        "\xA5" => '&#3589;',
+        "\xA6" => '&#3590;',
+        "\xA7" => '&#3591;',
+        "\xA8" => '&#3592;',
+        "\xA9" => '&#3593;',
+        "\xAA" => '&#3594;',
+        "\xAB" => '&#3595;',
+        "\xAC" => '&#3596;',
+        "\xAD" => '&#3597;',
+        "\xAE" => '&#3598;',
+        "\xAF" => '&#3599;',
+        "\xB0" => '&#3600;',
+        "\xB1" => '&#3601;',
+        "\xB2" => '&#3602;',
+        "\xB3" => '&#3603;',
+        "\xB4" => '&#3604;',
+        "\xB5" => '&#3605;',
+        "\xB6" => '&#3606;',
+        "\xB7" => '&#3607;',
+        "\xB8" => '&#3608;',
+        "\xB9" => '&#3609;',
+        "\xBA" => '&#3610;',
+        "\xBB" => '&#3611;',
+        "\xBC" => '&#3612;',
+        "\xBD" => '&#3613;',
+        "\xBE" => '&#3614;',
+        "\xBF" => '&#3615;',
+        "\xC0" => '&#3616;',
+        "\xC1" => '&#3617;',
+        "\xC2" => '&#3618;',
+        "\xC3" => '&#3619;',
+        "\xC4" => '&#3620;',
+        "\xC5" => '&#3621;',
+        "\xC6" => '&#3622;',
+        "\xC7" => '&#3623;',
+        "\xC8" => '&#3624;',
+        "\xC9" => '&#3625;',
+        "\xCA" => '&#3626;',
+        "\xCB" => '&#3627;',
+        "\xCC" => '&#3628;',
+        "\xCD" => '&#3629;',
+        "\xCE" => '&#3630;',
+        "\xCF" => '&#3631;',
+        "\xD0" => '&#3632;',
+        "\xD1" => '&#3633;',
+        "\xD2" => '&#3634;',
+        "\xD3" => '&#3635;',
+        "\xD4" => '&#3636;',
+        "\xD5" => '&#3637;',
+        "\xD6" => '&#3638;',
+        "\xD7" => '&#3639;',
+        "\xD8" => '&#3640;',
+        "\xD9" => '&#3641;',
+        "\xDA" => '&#3642;',
+        "\xDF" => '&#3647;',
+        "\xE0" => '&#3648;',
+        "\xE1" => '&#3649;',
+        "\xE2" => '&#3650;',
+        "\xE3" => '&#3651;',
+        "\xE4" => '&#3652;',
+        "\xE5" => '&#3653;',
+        "\xE6" => '&#3654;',
+        "\xE7" => '&#3655;',
+        "\xE8" => '&#3656;',
+        "\xE9" => '&#3657;',
+        "\xEA" => '&#3658;',
+        "\xEB" => '&#3659;',
+        "\xEC" => '&#3660;',
+        "\xED" => '&#3661;',
+        "\xEE" => '&#3662;',
+        "\xEF" => '&#3663;',
+        "\xF0" => '&#3664;',
+        "\xF1" => '&#3665;',
+        "\xF2" => '&#3666;',
+        "\xF3" => '&#3667;',
+        "\xF4" => '&#3668;',
+        "\xF5" => '&#3669;',
+        "\xF6" => '&#3670;',
+        "\xF7" => '&#3671;',
+        "\xF8" => '&#3672;',
+        "\xF9" => '&#3673;',
+        "\xFA" => '&#3674;',
+        "\xFB" => '&#3675;'
     );
 
     $string = str_replace(array_keys($iso8859_11), array_values($iso8859_11), $string);
@@ -151,4 +151,4 @@ function charset_decode_iso_8859_11 ($string) {
     return $string;
 }
 
-?>
+?>

+ 1 - 1
functions/decode/iso_8859_13.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-13 decoding function that is needed to read
  * iso-8859-13 encoded mails in non-iso-8859-13 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-13.TXT
  *

+ 2 - 2
functions/decode/iso_8859_14.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-14 decoding function that is needed to read
  * iso-8859-14 encoded mails in non-iso-8859-14 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-14.TXT
  *
@@ -44,7 +44,7 @@
 /**
  * Decode iso8859-14 encoded string
  * @param string $string Encoded string
- * @return string $string Decoded string 
+ * @return string $string Decoded string
  */
 function charset_decode_iso_8859_14 ($string) {
     global $default_charset;

+ 1 - 1
functions/decode/iso_8859_15.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-15 decoding function that is needed to read
  * iso-8859-15 encoded mails in non-iso-8859-15 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-15.TXT
  *

+ 1 - 1
functions/decode/iso_8859_16.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-16 decoding function that is needed to read
  * iso-8859-16 encoded mails in non-iso-8859-16 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-16.TXT
  *

+ 1 - 1
functions/decode/iso_8859_2.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-2 decoding function that is needed to read
  * iso-8859-2 encoded mails in non-iso-8859-2 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-2.TXT
  *

+ 1 - 1
functions/decode/iso_8859_3.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-3 decoding function that is needed to read
  * iso-8859-3 encoded mails in non-iso-8859-3 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-3.TXT
  *

+ 1 - 1
functions/decode/iso_8859_4.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-4 decoding function that is needed to read
  * iso-8859-4 encoded mails in non-iso-8859-4 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-4.TXT
  *

+ 1 - 1
functions/decode/iso_8859_5.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-5 decoding function that is needed to read
  * iso-8859-5 encoded mails in non-iso-8859-5 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-5.TXT
  *

+ 1 - 1
functions/decode/iso_8859_6.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-6 decoding function that is needed to read
  * iso-8859-6 encoded mails in non-iso-8859-6 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-6.TXT
  *

+ 1 - 1
functions/decode/iso_8859_7.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-7 decoding function that is needed to read
  * iso-8859-7 encoded mails in non-iso-8859-7 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-7.TXT
  *

+ 1 - 1
functions/decode/iso_8859_8.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-8 decoding function that is needed to read
  * iso-8859-8 encoded mails in non-iso-8859-8 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-8.TXT
  *

+ 1 - 1
functions/decode/iso_8859_9.php

@@ -7,7 +7,7 @@
  *
  * This file contains iso-8859-9 decoding function that is needed to read
  * iso-8859-9 encoded mails in non-iso-8859-9 locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-9.TXT
  *

+ 6 - 6
functions/decode/iso_ir_111.php

@@ -7,30 +7,30 @@
  *
  * This file contains iso-ir-111 decoding function that is needed to read
  * iso-ir-111 encoded mails in non-iso-ir-111 locale.
- * 
+ *
  * Original data taken from:
  *  http://crl.nmsu.edu/~mleisher/csets/ISOIR111.TXT
  *
- * Original ID: Id: ISOIR111.TXT,v 1.2 1999/08/23 18:34:15 mleisher Exp 
+ * Original ID: Id: ISOIR111.TXT,v 1.2 1999/08/23 18:34:15 mleisher Exp
  *   Name:             ISO IR 111/ECMA Cyrillic to Unicode 2.1 mapping table.
- * Typed in by hand from 
+ * Typed in by hand from
  *    http://www.fingertipsoft.com/ref/cyrillic/charsets.html
  * Author: Mark Leisher <mleisher@crl.nmsu.edu>
  * Date: 05 March 1998
  *
  * Original copyright:
  * Copyright 1999 Computing Research Labs, New Mexico State University
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the ""Software""),
  * to deal in the Software without restriction, including without limitation
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL

+ 1 - 1
functions/decode/koi8_r.php

@@ -7,7 +7,7 @@
  *
  * This file contains koi8-r decoding function that is needed to read
  * koi8-r encoded mails in non-koi8-r locale.
- * 
+ *
  * Original data taken from:
  *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT
  *

+ 1 - 1
functions/decode/koi8_u.php

@@ -7,7 +7,7 @@
  *
  * This file contains koi8-u decoding function that is needed to read
  * koi8-u encoded mails in non-koi8-u locale.
- * 
+ *
  * Original data taken from rfc2319
  *
  * Original copyright:

+ 2 - 2
functions/decode/ns_4551_1.php

@@ -10,7 +10,7 @@
  * ns_4551-1 encoded mails in non-ns_4551-1 locale.
  *
  * This is the same as ISO-646-NO and is used by some
- * Microsoft programs when sending Norwegian characters 
+ * Microsoft programs when sending Norwegian characters
  *
  * @version $Id$
  * @package squirrelmail
@@ -21,7 +21,7 @@
  * ns_4551_1 decoding function
  *
  * @param string $string
- * @return string 
+ * @return string
  */
 function charset_decode_ns_4551_1 ($string) {
     /*

+ 2 - 2
functions/decode/tis_620.php

@@ -7,14 +7,14 @@
  *
  * This file contains tis620 decoding function that is needed to read
  * tis620 encoded mails in non-tis620 locale.
- * 
+ *
  * Original data taken from:
  *  http://www.inet.co.th/cyberclub/trin/thairef/tis620-iso10646.html
  *
  * Original copyright:
  *  Note: The information contained herein is provided as-is. It was
  *  complied from various references given at the end of the page.
- *  The author (trin@mozart.inet.co.th) believes all information 
+ *  The author (trin@mozart.inet.co.th) believes all information
  *  presented here is accurate.
  *
  *     References

+ 1 - 1
functions/decode/utf_8.php

@@ -15,7 +15,7 @@
  * \a\b\c characters are decoded to html code octdec(a-340)*64*64 + octdec(b-200)*64 + octdec(c-200)
  *
  * decoding cycle is unfinished. please test and report problems to tokul@users.sourceforge.net
- * 
+ *
  * @version $Id$
  * @package squirrelmail
  * @subpackage decode

+ 1 - 1
functions/display_messages.php

@@ -173,7 +173,7 @@ function error_option_save($message) {
     global $optpage_save_error;
 
     if (! is_array($optpage_save_error) )
-	$optpage_save_error=array();
+        $optpage_save_error=array();
 
     $optpage_save_error=array_merge($optpage_save_error,array($message));
 }

+ 5 - 5
functions/encode/cp1251.php

@@ -22,17 +22,17 @@ function charset_encode_cp1251 ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetocp1251('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetocp1251(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return cp1251 symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_cp1251 
+ *
+ * This function is used internally by charset_encode_cp1251
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/cp1251.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/cp1251.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string cp1251 character

+ 5 - 5
functions/encode/cp1255.php

@@ -22,17 +22,17 @@ function charset_encode_cp1255 ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetocp1255('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetocp1255(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return cp1255 symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_cp1255 
+ *
+ * This function is used internally by charset_encode_cp1255
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/cp1255.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/cp1255.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string cp1255 character

+ 5 - 5
functions/encode/cp1256.php

@@ -22,17 +22,17 @@ function charset_encode_cp1256 ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetocp1256('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetocp1256(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return cp1256 symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_cp1256 
+ *
+ * This function is used internally by charset_encode_cp1256
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/cp1256.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/cp1256.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string cp1256 character

+ 5 - 5
functions/encode/iso_8859_1.php

@@ -22,17 +22,17 @@ function charset_encode_iso_8859_1 ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetoiso88591('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetoiso88591(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return iso-8859-1 symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_iso_8859_1 
+ *
+ * This function is used internally by charset_encode_iso_8859_1
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/iso_8859_1.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/iso_8859_1.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string iso-8859-1 character

+ 5 - 5
functions/encode/iso_8859_15.php

@@ -22,17 +22,17 @@ function charset_encode_iso_8859_15 ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetoiso885915('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetoiso885915(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return iso-8859-15 symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_iso_8859_15 
+ *
+ * This function is used internally by charset_encode_iso_8859_15
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/iso_8859_15.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/iso_8859_15.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string iso-8859-15 character

+ 5 - 5
functions/encode/iso_8859_2.php

@@ -22,17 +22,17 @@ function charset_encode_iso_8859_2 ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetoiso88592('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetoiso88592(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return iso-8859-2 symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_iso_8859_2 
+ *
+ * This function is used internally by charset_encode_iso_8859_2
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/iso_8859_2.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/iso_8859_2.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string iso-8859-2 character

+ 5 - 5
functions/encode/iso_8859_7.php

@@ -22,17 +22,17 @@ function charset_encode_iso_8859_7 ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetoiso88597('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetoiso88597(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return iso-8859-7 symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_iso_8859_7 
+ *
+ * This function is used internally by charset_encode_iso_8859_7
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/iso_8859_7.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/iso_8859_7.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string iso-8859-7 character

+ 5 - 5
functions/encode/iso_8859_9.php

@@ -22,17 +22,17 @@ function charset_encode_iso_8859_9 ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetoiso88599('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetoiso88599(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return iso-8859-9 symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_iso_8859_9 
+ *
+ * This function is used internally by charset_encode_iso_8859_9
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/iso_8859_9.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/iso_8859_9.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string iso-8859-9 character

+ 5 - 5
functions/encode/koi8_r.php

@@ -22,17 +22,17 @@ function charset_encode_koi8_r ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetokoi8r('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetokoi8r(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return koi8-r symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_koi8_r 
+ *
+ * This function is used internally by charset_encode_koi8_r
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/koi8_r.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/koi8_r.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string koi8-r character

+ 5 - 5
functions/encode/koi8_u.php

@@ -22,17 +22,17 @@ function charset_encode_koi8_u ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetokoi8u('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetokoi8u(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return koi8-u symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_koi8_u 
+ *
+ * This function is used internally by charset_encode_koi8_u
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/koi8_u.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/koi8_u.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string koi8-u character

+ 5 - 5
functions/encode/tis_620.php

@@ -22,17 +22,17 @@ function charset_encode_tis_620 ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetotis620('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetotis620(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return tis-620 symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_tis_620 
+ *
+ * This function is used internally by charset_encode_tis_620
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/tis_620.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/tis_620.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string tis-620 character

+ 4 - 4
functions/encode/us_ascii.php

@@ -22,17 +22,17 @@ function charset_encode_us_ascii ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetousascii('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetousascii(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return us-ascii symbol when unicode character number is provided
- * 
+ *
  * This function is used internally by charset_encode_us_ascii
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/us_ascii.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/us_ascii.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string us-ascii character

+ 6 - 6
functions/encode/utf_8.php

@@ -26,17 +26,17 @@ function charset_encode_utf_8 ($string) {
 
     $string=preg_replace("/&#([0-9]+);/e","unicodetoutf8('\\1')",$string);
     // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetoutf8(hexdec('\\1'))",$string);
-    
+
     return $string;
 }
 
 /**
  * Return utf8 symbol when unicode character number is provided
- * 
- * This function is used internally by charset_encode_utf_8 
+ *
+ * This function is used internally by charset_encode_utf_8
  * function. It might be unavailable to other squirrelmail functions.
- * Don't use it or make sure, that functions/encode/utf_8.php is 
- * included. 
+ * Don't use it or make sure, that functions/encode/utf_8.php is
+ * included.
  *
  * @param int $var decimal unicode value
  * @return string utf8 character
@@ -50,7 +50,7 @@ function unicodetoutf8($var) {
         $binVal = str_pad (decbin ($var), 11, "0", STR_PAD_LEFT);
         $binPart1 = substr ($binVal, 0, 5);
         $binPart2 = substr ($binVal, 5);
-        
+
         $char1 = chr (192 + bindec ($binPart1));
         $char2 = chr (128 + bindec ($binPart2));
         $ret = $char1 . $char2;

+ 4 - 4
functions/html.php

@@ -99,7 +99,7 @@ function html_tag( $tag,                // Tag to output
                        '/.+(\\?'.$var.')=(.*)$/AU',     /* at front and only var */
                        '/.+(\\&'.$var.')=(.*)$/AU'      /* at the end */
                      );
-	preg_replace('/&amp;/','&',$url);
+        preg_replace('/&amp;/','&',$url);
         switch (true) {
             case (preg_match($pat_a[0],$url,$regs)):
                 $k = $regs[1];
@@ -131,9 +131,9 @@ function html_tag( $tag,                // Tag to output
         if ($k) {
             if ($val) {
                 $rpl = "$k=$val";
-		if ($link) {
-		    $rpl = preg_replace('/&/','&amp;',$rpl);
-		}
+                if ($link) {
+                    $rpl = preg_replace('/&/','&amp;',$rpl);
+                }
             } else {
                 $rpl = '';
             }

+ 1 - 1
functions/htmlentities/index.php

@@ -10,4 +10,4 @@
  */
 header("Location:../../src/login.php\n\n");
 exit();
-?>
+?>

+ 97 - 97
functions/htmlentities/iso-8859-1.php

@@ -9,101 +9,101 @@
  * @subpackage strings
  */
 $sq_html_ent_table = array_merge($sq_html_ent_table,
-	array("\xA0" => '&nbsp;',
-	      "\xA1" => '&iexcl;',
-	      "\xA2" => '&cent;',
-	      "\xA3" => '&pound;',
-	      "\xA4" => '&curren;',
-	      "\xA5" => '&yen;',
-	      "\xA6" => '&brvbar;',
-	      "\xA7" => '&sect;',
-	      "\xA8" => '&uml;',
-	      "\xA9" => '&copy;',
-	      "\xAA" => '&ordf;',
-	      "\xAB" => '&laquo;',
-	      "\xAC" => '&not;',
-	      "\xAD" => '&shy;',
-	      "\xAE" => '&reg;',
-	      "\xAF" => '&macr;',
-	      "\xB0" => '&deg;',
-	      "\xB1" => '&plusmn;',
-	      "\xB2" => '&sup2;',
-	      "\xB3" => '&sup3;',
-    	      "\xB4" => '&acute;',
-	      "\xB5" => '&micro;',
-	      "\xB6" => '&para;',
-	      "\xB7" => '&middot;',
-	      "\xB8" => '&cedil;',
-	      "\xB9" => '&sup1;',
-	      "\xBA" => '&ordm;',
-	      "\xBB" => '&raquo;',
-	      "\xBC" => '&frac14;',
-	      "\xBD" => '&frac12;',
-    	      "\xBE" => '&frac34;',
-	      "\xBF" => '&iquest;',
-	      "\xC0" => '&Agrave;',
-	      "\xC1" => '&Aacute;',
-	      "\xC2" => '&Acirc;',
-	      "\xC3" => '&Atilde;',
-	      "\xC4" => '&Auml;',
-	      "\xC5" => '&Aring;',
-	      "\xC6" => '&AElig;',
-	      "\xC7" => '&Ccedil;',
-	      "\xC8" => '&Egrave;',
-	      "\xC9" => '&Eacute;',
-	      "\xCA" => '&Ecirc;',
-	      "\xCB" => '&Euml;',
-	      "\xCC" => '&Igrave;',
-	      "\xCD" => '&Iacute;',
-	      "\xCE" => '&Icirc;',
-	      "\xCF" => '&Iuml;',
-	      "\xD0" => '&ETH;',
-	      "\xD1" => '&Ntilde;',
-	      "\xD2" => '&Ograve;',
-	      "\xD3" => '&Oacute;',
-	      "\xD4" => '&Ocirc;',
-	      "\xD5" => '&Otilde;',
-	      "\xD6" => '&Ouml;',
-	      "\xD7" => '&times;',
-	      "\xD8" => '&Oslash;',
-	      "\xD9" => '&Ugrave;',
-	      "\xDA" => '&Uacute;',
-	      "\xDB" => '&Ucirc;',
-	      "\xDC" => '&Uuml;',
-	      "\xDD" => '&Yacute;',
-	      "\xDE" => '&THORN;',
-	      "\xDF" => '&szlig;',
-	      "\xE0" => '&agrave;',
-	      "\xE1" => '&aacute;',
-	      "\xE2" => '&acirc;',
-	      "\xE3" => '&atilde;',
-	      "\xE4" => '&auml;',
-    	      "\xE5" => '&aring;',
-	      "\xE6" => '&aelig;',
-	      "\xE7" => '&ccedil;',
-	      "\xE8" => '&egrave;',
-	      "\xE9" => '&eacute;',
-	      "\xEA" => '&ecirc;',
-	      "\xEB" => '&euml;',
-	      "\xEC" => '&igrave;',
-	      "\xED" => '&iacute;',
-	      "\xEE" => '&icirc;',
-	      "\xEF" => '&iuml;',
-	      "\xF0" => '&eth;',
-	      "\xF1" => '&ntilde;',
-	      "\xF2" => '&ograve;',
-	      "\xF3" => '&oacute;',
-	      "\xF4" => '&ocirc;',
-	      "\xF5" => '&otilde;',
-	      "\xF6" => '&ouml;',
-	      "\xF7" => '&divide;',
-	      "\xF8" => '&oslash;',
-	      "\xF9" => '&ugrave;',
-	      "\xFA" => '&uacute;',
-	      "\xFB" => '&ucirc;',
-	      "\xFC" => '&uuml;',
-	      "\xFD" => '&yacute;',
-	      "\xFE" => '&thorn;',
-	      "\xFF" => '&yuml;')
-		);
+        array("\xA0" => '&nbsp;',
+              "\xA1" => '&iexcl;',
+              "\xA2" => '&cent;',
+              "\xA3" => '&pound;',
+              "\xA4" => '&curren;',
+              "\xA5" => '&yen;',
+              "\xA6" => '&brvbar;',
+              "\xA7" => '&sect;',
+              "\xA8" => '&uml;',
+              "\xA9" => '&copy;',
+              "\xAA" => '&ordf;',
+              "\xAB" => '&laquo;',
+              "\xAC" => '&not;',
+              "\xAD" => '&shy;',
+              "\xAE" => '&reg;',
+              "\xAF" => '&macr;',
+              "\xB0" => '&deg;',
+              "\xB1" => '&plusmn;',
+              "\xB2" => '&sup2;',
+              "\xB3" => '&sup3;',
+              "\xB4" => '&acute;',
+              "\xB5" => '&micro;',
+              "\xB6" => '&para;',
+              "\xB7" => '&middot;',
+              "\xB8" => '&cedil;',
+              "\xB9" => '&sup1;',
+              "\xBA" => '&ordm;',
+              "\xBB" => '&raquo;',
+              "\xBC" => '&frac14;',
+              "\xBD" => '&frac12;',
+              "\xBE" => '&frac34;',
+              "\xBF" => '&iquest;',
+              "\xC0" => '&Agrave;',
+              "\xC1" => '&Aacute;',
+              "\xC2" => '&Acirc;',
+              "\xC3" => '&Atilde;',
+              "\xC4" => '&Auml;',
+              "\xC5" => '&Aring;',
+              "\xC6" => '&AElig;',
+              "\xC7" => '&Ccedil;',
+              "\xC8" => '&Egrave;',
+              "\xC9" => '&Eacute;',
+              "\xCA" => '&Ecirc;',
+              "\xCB" => '&Euml;',
+              "\xCC" => '&Igrave;',
+              "\xCD" => '&Iacute;',
+              "\xCE" => '&Icirc;',
+              "\xCF" => '&Iuml;',
+              "\xD0" => '&ETH;',
+              "\xD1" => '&Ntilde;',
+              "\xD2" => '&Ograve;',
+              "\xD3" => '&Oacute;',
+              "\xD4" => '&Ocirc;',
+              "\xD5" => '&Otilde;',
+              "\xD6" => '&Ouml;',
+              "\xD7" => '&times;',
+              "\xD8" => '&Oslash;',
+              "\xD9" => '&Ugrave;',
+              "\xDA" => '&Uacute;',
+              "\xDB" => '&Ucirc;',
+              "\xDC" => '&Uuml;',
+              "\xDD" => '&Yacute;',
+              "\xDE" => '&THORN;',
+              "\xDF" => '&szlig;',
+              "\xE0" => '&agrave;',
+              "\xE1" => '&aacute;',
+              "\xE2" => '&acirc;',
+              "\xE3" => '&atilde;',
+              "\xE4" => '&auml;',
+              "\xE5" => '&aring;',
+              "\xE6" => '&aelig;',
+              "\xE7" => '&ccedil;',
+              "\xE8" => '&egrave;',
+              "\xE9" => '&eacute;',
+              "\xEA" => '&ecirc;',
+              "\xEB" => '&euml;',
+              "\xEC" => '&igrave;',
+              "\xED" => '&iacute;',
+              "\xEE" => '&icirc;',
+              "\xEF" => '&iuml;',
+              "\xF0" => '&eth;',
+              "\xF1" => '&ntilde;',
+              "\xF2" => '&ograve;',
+              "\xF3" => '&oacute;',
+              "\xF4" => '&ocirc;',
+              "\xF5" => '&otilde;',
+              "\xF6" => '&ouml;',
+              "\xF7" => '&divide;',
+              "\xF8" => '&oslash;',
+              "\xF9" => '&ugrave;',
+              "\xFA" => '&uacute;',
+              "\xFB" => '&ucirc;',
+              "\xFC" => '&uuml;',
+              "\xFD" => '&yacute;',
+              "\xFE" => '&thorn;',
+              "\xFF" => '&yuml;')
+                );
 ?>

+ 2 - 2
functions/htmlentities/readme.php

@@ -4,7 +4,7 @@
  *
  * SquirrelMail provides own implementation of htmlentities() and
  * get_html_translation_table() functions. Functions are called
- * sq_get_html_translation_table() and sq_htmlentities(). They are 
+ * sq_get_html_translation_table() and sq_htmlentities(). They are
  * included in functions/strings.php
  *
  * sq_htmlentities uses same syntax as functions available in php 4.1.0
@@ -20,7 +20,7 @@
  * it returns translation table defined by charset. Function defaults to us-ascii charset
  * and not to iso-8859-1.
  *
- * Why own functions are used instead of htmlspecialchars() and 
+ * Why own functions are used instead of htmlspecialchars() and
  * htmlentities() provided by php.
  *
  * <ul>

+ 262 - 262
functions/htmlentities/utf-8.php

@@ -9,267 +9,267 @@
  * @subpackage strings
  */
 $sq_html_ent_table = array_merge($sq_html_ent_table,
-	 array(// Latin1
-	      "\xC2\xA0" => '&nbsp;',
-	      "\xC2\xA1" => '&iexcl;',
-	      "\xC2\xA2" => '&cent;',
-	      "\xC2\xA3" => '&pound;',
-	      "\xC2\xA4" => '&curren;',
-	      "\xC2\xA5" => '&yen;',
-	      "\xC2\xA6" => '&brvbar;',
-	      "\xC2\xA7" => '&sect;',
-	      "\xC2\xA8" => '&uml;',
-	      "\xC2\xA9" => '&copy;',
-	      "\xC2\xAA" => '&ordf;',
-	      "\xC2\xAB" => '&laquo;',
-	      "\xC2\xAC" => '&not;',
-	      "\xC2\xAD" => '&shy;',
-	      "\xC2\xAE" => '&reg;',
-	      "\xC2\xAF" => '&macr;',
-	      "\xC2\xB0" => '&deg;',
-	      "\xC2\xB1" => '&plusmn;',
-	      "\xC2\xB2" => '&sup2;',
-	      "\xC2\xB3" => '&sup3;',
-	      "\xC2\xB4" => '&acute;',
-	      "\xC2\xB5" => '&micro;',
-	      "\xC2\xB6" => '&para;',
-	      "\xC2\xB7" => '&middot;',
-	      "\xC2\xB8" => '&cedil;',
-	      "\xC2\xB9" => '&sup1;',
-	      "\xC2\xBA" => '&ordm;',
-	      "\xC2\xBB" => '&raquo;',
-	      "\xC2\xBC" => '&frac14;',
-	      "\xC2\xBD" => '&frac12;',
-	      "\xC2\xBE" => '&frac34;',
-	      "\xC2\xBF" => '&iquest;',
-	      "\xC3\x80" => '&Agrave;',
-	      "\xC3\x81" => '&Aacute;',
-	      "\xC3\x82" => '&Acirc;',
-	      "\xC3\x83" => '&Atilde;',
-	      "\xC3\x84" => '&Auml;',
-	      "\xC3\x85" => '&Aring;',
-	      "\xC3\x86" => '&AElig;',
-	      "\xC3\x87" => '&Ccedil;',
-	      "\xC3\x88" => '&Egrave;',
-	      "\xC3\x89" => '&Eacute;',
-	      "\xC3\x8A" => '&Ecirc;',
-	      "\xC3\x8B" => '&Euml;',
-	      "\xC3\x8C" => '&Igrave;',
-	      "\xC3\x8D" => '&Iacute;',
-	      "\xC3\x8E" => '&Icirc;',
-	      "\xC3\x8F" => '&Iuml;',
-	      "\xC3\x90" => '&ETH;',
-	      "\xC3\x91" => '&Ntilde;',
-	      "\xC3\x92" => '&Ograve;',
-	      "\xC3\x93" => '&Oacute;',
-	      "\xC3\x94" => '&Ocirc;',
-	      "\xC3\x95" => '&Otilde;',
-	      "\xC3\x96" => '&Ouml;',
-	      "\xC3\x97" => '&times;',
-	      "\xC3\x98" => '&Oslash;',
-	      "\xC3\x99" => '&Ugrave;',
-	      "\xC3\x9A" => '&Uacute;',
-	      "\xC3\x9B" => '&Ucirc;',
-	      "\xC3\x9C" => '&Uuml;',
-	      "\xC3\x9D" => '&Yacute;',
-	      "\xC3\x9E" => '&THORN;',
-	      "\xC3\x9F" => '&szlig;',
-	      "\xC3\xA0" => '&agrave;',
-	      "\xC3\xA1" => '&aacute;',
-	      "\xC3\xA2" => '&acirc;',
-	      "\xC3\xA3" => '&atilde;',
-	      "\xC3\xA4" => '&auml;',
-	      "\xC3\xA5" => '&aring;',
-	      "\xC3\xA6" => '&aelig;',
-	      "\xC3\xA7" => '&ccedil;',
-	      "\xC3\xA8" => '&egrave;',
-	      "\xC3\xA9" => '&eacute;',
-	      "\xC3\xAA" => '&ecirc;',
-	      "\xC3\xAB" => '&euml;',
-	      "\xC3\xAC" => '&igrave;',
-	      "\xC3\xAD" => '&iacute;',
-	      "\xC3\xAE" => '&icirc;',
-	      "\xC3\xAF" => '&iuml;',
-	      "\xC3\xB0" => '&eth;',
-	      "\xC3\xB1" => '&ntilde;',
-	      "\xC3\xB2" => '&ograve;',
-	      "\xC3\xB3" => '&oacute;',
-	      "\xC3\xB4" => '&ocirc;',
-	      "\xC3\xB5" => '&otilde;',
-	      "\xC3\xB6" => '&ouml;',
-	      "\xC3\xB7" => '&divide;',
-	      "\xC3\xB8" => '&oslash;',
-	      "\xC3\xB9" => '&ugrave;',
-	      "\xC3\xBA" => '&uacute;',
-	      "\xC3\xBB" => '&ucirc;',
-	      "\xC3\xBC" => '&uuml;',
-	      "\xC3\xBD" => '&yacute;',
-	      "\xC3\xBE" => '&thorn;',
-	      "\xC3\xBF" => '&yuml;',
-	      // Latin Extended-A
-	      "\xC5\x92" => '&OElig;',
-	      "\xC5\x93" => '&oelig;',
-	      "\xC5\xA0" => '&Scaron;',
-	      "\xC5\xA1" => '&scaron;',
-	      "\xC5\xB8" => '&Yuml;',
-	      // Spacing Modifier Letters
-	      "\xCB\x86" => '&circ;',
-	      "\xCB\x9C" => '&tilde;',
-	      // General Punctuation
-	      "\xE2\x80\x82" => '&ensp;',
-	      "\xE2\x80\x83" => '&emsp;',
-	      "\xE2\x80\x89" => '&thinsp;',
-	      "\xE2\x80\x8C" => '&zwnj;',
-	      "\xE2\x80\x8D" => '&zwj;',
-	      "\xE2\x80\x8E" => '&lrm;',
-	      "\xE2\x80\x8F" => '&rlm;',
-	      "\xE2\x80\x93" => '&ndash;',
-	      "\xE2\x80\x94" => '&mdash;',
-	      "\xE2\x80\x98" => '&lsquo;',
-	      "\xE2\x80\x99" => '&rsquo;',
-	      "\xE2\x80\x9A" => '&sbquo;',
-	      "\xE2\x80\x9C" => '&ldquo;',
-	      "\xE2\x80\x9D" => '&rdquo;',
-	      "\xE2\x80\x9E" => '&bdquo;',
-	      "\xE2\x80\xA0" => '&dagger;',
-	      "\xE2\x80\xA1" => '&Dagger;',
-	      "\xE2\x80\xB0" => '&permil;',
-	      "\xE2\x80\xB9" => '&lsaquo;',
-	      "\xE2\x80\xBA" => '&rsaquo;',
-	      "\xE2\x82\xAC" => '&euro;',
-	      // Latin Extended-B
-	      "\xC6\x92" => '&fnof;',
-	      // Greek
-	      "\xCE\x91" => '&Alpha;',
-	      "\xCE\x92" => '&Beta;',
-	      "\xCE\x93" => '&Gamma;',
-	      "\xCE\x94" => '&Delta;',
-	      "\xCE\x95" => '&Epsilon;',
-	      "\xCE\x96" => '&Zeta;',
-	      "\xCE\x97" => '&Eta;',
-	      "\xCE\x98" => '&Theta;',
-	      "\xCE\x99" => '&Iota;',
-	      "\xCE\x9A" => '&Kappa;',
-	      "\xCE\x9B" => '&Lambda;',
-	      "\xCE\x9C" => '&Mu;',
-	      "\xCE\x9D" => '&Nu;',
-	      "\xCE\x9E" => '&Xi;',
-	      "\xCE\x9F" => '&Omicron;',
-	      "\xCE\xA0" => '&Pi;',
-	      "\xCE\xA1" => '&Rho;',
-	      "\xCE\xA3" => '&Sigma;',
-	      "\xCE\xA4" => '&Tau;',
-	      "\xCE\xA5" => '&Upsilon;',
-	      "\xCE\xA6" => '&Phi;',
-	      "\xCE\xA7" => '&Chi;',
-	      "\xCE\xA8" => '&Psi;',
-	      "\xCE\xA9" => '&Omega;',
-	      "\xCE\xB1" => '&alpha;',
-	      "\xCE\xB2" => '&beta;',
-	      "\xCE\xB3" => '&gamma;',
-	      "\xCE\xB4" => '&delta;',
-	      "\xCE\xB5" => '&epsilon;',
-	      "\xCE\xB6" => '&zeta;',
-	      "\xCE\xB7" => '&eta;',
-	      "\xCE\xB8" => '&theta;',
-	      "\xCE\xB9" => '&iota;',
-	      "\xCE\xBA" => '&kappa;',
-	      "\xCE\xBB" => '&lambda;',
-	      "\xCE\xBC" => '&mu;',
-	      "\xCE\xBD" => '&nu;',
-	      "\xCE\xBE" => '&xi;',
-	      "\xCE\xBF" => '&omicron;',
-	      "\xCF\x80" => '&pi;',
-	      "\xCF\x81" => '&rho;',
-	      "\xCF\x82" => '&sigmaf;',
-	      "\xCF\x83" => '&sigma;',
-	      "\xCF\x84" => '&tau;',
-	      "\xCF\x85" => '&upsilon;',
-	      "\xCF\x86" => '&phi;',
-	      "\xCF\x87" => '&chi;',
-	      "\xCF\x88" => '&psi;',
-	      "\xCF\x89" => '&omega;',
-	      "\xCF\x91" => '&thetasym;',
-	      "\xCF\x92" => '&upsih;',
-	      "\xCF\x96" => '&piv;',
-	      // General Punctuation
-	      "\xE2\x80\xA2" => '&bull;',
-	      "\xE2\x80\xA6" => '&hellip;',
-	      "\xE2\x80\xB2" => '&prime;',
-	      "\xE2\x80\xB3" => '&Prime;',
-	      "\xE2\x80\xBE" => '&oline;',
-	      "\xE2\x81\x84" => '&frasl;',
-	      // Letterlike Symbols
-	      "\xE2\x84\x98" => '&weierp;',
-	      "\xE2\x84\x91" => '&image;',
-	      "\xE2\x84\x9C" => '&real;',
-	      "\xE2\x84\xA2" => '&trade;',
-	      "\xE2\x84\xB5" => '&alefsym;',
- 	      // Arrows
-	      "\xE2\x86\x90" => '&larr;',
-	      "\xE2\x86\x91" => '&uarr;',
-	      "\xE2\x86\x92" => '&rarr;',
-	      "\xE2\x86\x93" => '&darr;',
-	      "\xE2\x86\x94" => '&harr;',
-	      "\xE2\x86\xB5" => '&crarr;',
-	      "\xE2\x87\x90" => '&lArr;',
-	      "\xE2\x87\x91" => '&uArr;',
-	      "\xE2\x87\x92" => '&rArr;',
-	      "\xE2\x87\x93" => '&dArr;',
-	      "\xE2\x87\x94" => '&hArr;',
-	      // Mathematical Operators
-	      "\xE2\x88\x80" => '&forall;',
-	      "\xE2\x88\x82" => '&part;',
-	      "\xE2\x88\x83" => '&exist;',
-	      "\xE2\x88\x85" => '&empty;',
-	      "\xE2\x88\x87" => '&nabla;',
-	      "\xE2\x88\x88" => '&isin;',
-	      "\xE2\x88\x89" => '&notin;',
-	      "\xE2\x88\x8B" => '&ni;',
-	      "\xE2\x88\x8F" => '&prod;',
-	      "\xE2\x88\x91" => '&sum;',
-	      "\xE2\x88\x92" => '&minus;',
-	      "\xE2\x88\x97" => '&lowast;',
-	      "\xE2\x88\x9A" => '&radic;',
-	      "\xE2\x88\x9D" => '&prop;',
-	      "\xE2\x88\x9E" => '&infin;',
-	      "\xE2\x88\xA0" => '&ang;',
-	      "\xE2\x88\xA7" => '&and;',
-	      "\xE2\x88\xA8" => '&or;',
-	      "\xE2\x88\xA9" => '&cap;',
-	      "\xE2\x88\xAA" => '&cup;',
-	      "\xE2\x88\xAB" => '&int;',
-	      "\xE2\x88\xB4" => '&there4;',
-	      "\xE2\x88\xBC" => '&sim;',
-	      "\xE2\x89\x85" => '&cong;',
-	      "\xE2\x89\x88" => '&asymp;',
-	      "\xE2\x89\xA0" => '&ne;',
-	      "\xE2\x89\xA1" => '&equiv;',
-	      "\xE2\x89\xA4" => '&le;',
-	      "\xE2\x89\xA5" => '&ge;',
-	      "\xE2\x8A\x82" => '&sub;',
-	      "\xE2\x8A\x83" => '&sup;',
-	      "\xE2\x8A\x84" => '&nsub;',
-	      "\xE2\x8A\x86" => '&sube;',
-	      "\xE2\x8A\x87" => '&supe;',
-	      "\xE2\x8A\x95" => '&oplus;',
-	      "\xE2\x8A\x97" => '&otimes;',
-	      "\xE2\x8A\xA5" => '&perp;',
-	      "\xE2\x8B\x85" => '&sdot;',
-	      // Miscellaneous Technical
-	      "\xE2\x8C\x88" => '&lceil;',
-	      "\xE2\x8C\x89" => '&rceil;',
-	      "\xE2\x8C\x8A" => '&lfloor;',
-	      "\xE2\x8C\x8B" => '&rfloor;',
-	      "\xE2\x8C\xA9" => '&lang;',
-	      "\xE2\x8C\xAA" => '&rang;',
-	      // Geometric Shapes
-	      "\xE2\x97\x8A" => '&loz;',
-	      // Miscellaneous Symbols
-	      "\xE2\x99\xA0" => '&spades;',
-	      "\xE2\x99\xA3" => '&clubs;',
-	      "\xE2\x99\xA5" => '&hearts;',
-	      "\xE2\x99\xA6" => '&diams;'
-	      )
+         array(// Latin1
+              "\xC2\xA0" => '&nbsp;',
+              "\xC2\xA1" => '&iexcl;',
+              "\xC2\xA2" => '&cent;',
+              "\xC2\xA3" => '&pound;',
+              "\xC2\xA4" => '&curren;',
+              "\xC2\xA5" => '&yen;',
+              "\xC2\xA6" => '&brvbar;',
+              "\xC2\xA7" => '&sect;',
+              "\xC2\xA8" => '&uml;',
+              "\xC2\xA9" => '&copy;',
+              "\xC2\xAA" => '&ordf;',
+              "\xC2\xAB" => '&laquo;',
+              "\xC2\xAC" => '&not;',
+              "\xC2\xAD" => '&shy;',
+              "\xC2\xAE" => '&reg;',
+              "\xC2\xAF" => '&macr;',
+              "\xC2\xB0" => '&deg;',
+              "\xC2\xB1" => '&plusmn;',
+              "\xC2\xB2" => '&sup2;',
+              "\xC2\xB3" => '&sup3;',
+              "\xC2\xB4" => '&acute;',
+              "\xC2\xB5" => '&micro;',
+              "\xC2\xB6" => '&para;',
+              "\xC2\xB7" => '&middot;',
+              "\xC2\xB8" => '&cedil;',
+              "\xC2\xB9" => '&sup1;',
+              "\xC2\xBA" => '&ordm;',
+              "\xC2\xBB" => '&raquo;',
+              "\xC2\xBC" => '&frac14;',
+              "\xC2\xBD" => '&frac12;',
+              "\xC2\xBE" => '&frac34;',
+              "\xC2\xBF" => '&iquest;',
+              "\xC3\x80" => '&Agrave;',
+              "\xC3\x81" => '&Aacute;',
+              "\xC3\x82" => '&Acirc;',
+              "\xC3\x83" => '&Atilde;',
+              "\xC3\x84" => '&Auml;',
+              "\xC3\x85" => '&Aring;',
+              "\xC3\x86" => '&AElig;',
+              "\xC3\x87" => '&Ccedil;',
+              "\xC3\x88" => '&Egrave;',
+              "\xC3\x89" => '&Eacute;',
+              "\xC3\x8A" => '&Ecirc;',
+              "\xC3\x8B" => '&Euml;',
+              "\xC3\x8C" => '&Igrave;',
+              "\xC3\x8D" => '&Iacute;',
+              "\xC3\x8E" => '&Icirc;',
+              "\xC3\x8F" => '&Iuml;',
+              "\xC3\x90" => '&ETH;',
+              "\xC3\x91" => '&Ntilde;',
+              "\xC3\x92" => '&Ograve;',
+              "\xC3\x93" => '&Oacute;',
+              "\xC3\x94" => '&Ocirc;',
+              "\xC3\x95" => '&Otilde;',
+              "\xC3\x96" => '&Ouml;',
+              "\xC3\x97" => '&times;',
+              "\xC3\x98" => '&Oslash;',
+              "\xC3\x99" => '&Ugrave;',
+              "\xC3\x9A" => '&Uacute;',
+              "\xC3\x9B" => '&Ucirc;',
+              "\xC3\x9C" => '&Uuml;',
+              "\xC3\x9D" => '&Yacute;',
+              "\xC3\x9E" => '&THORN;',
+              "\xC3\x9F" => '&szlig;',
+              "\xC3\xA0" => '&agrave;',
+              "\xC3\xA1" => '&aacute;',
+              "\xC3\xA2" => '&acirc;',
+              "\xC3\xA3" => '&atilde;',
+              "\xC3\xA4" => '&auml;',
+              "\xC3\xA5" => '&aring;',
+              "\xC3\xA6" => '&aelig;',
+              "\xC3\xA7" => '&ccedil;',
+              "\xC3\xA8" => '&egrave;',
+              "\xC3\xA9" => '&eacute;',
+              "\xC3\xAA" => '&ecirc;',
+              "\xC3\xAB" => '&euml;',
+              "\xC3\xAC" => '&igrave;',
+              "\xC3\xAD" => '&iacute;',
+              "\xC3\xAE" => '&icirc;',
+              "\xC3\xAF" => '&iuml;',
+              "\xC3\xB0" => '&eth;',
+              "\xC3\xB1" => '&ntilde;',
+              "\xC3\xB2" => '&ograve;',
+              "\xC3\xB3" => '&oacute;',
+              "\xC3\xB4" => '&ocirc;',
+              "\xC3\xB5" => '&otilde;',
+              "\xC3\xB6" => '&ouml;',
+              "\xC3\xB7" => '&divide;',
+              "\xC3\xB8" => '&oslash;',
+              "\xC3\xB9" => '&ugrave;',
+              "\xC3\xBA" => '&uacute;',
+              "\xC3\xBB" => '&ucirc;',
+              "\xC3\xBC" => '&uuml;',
+              "\xC3\xBD" => '&yacute;',
+              "\xC3\xBE" => '&thorn;',
+              "\xC3\xBF" => '&yuml;',
+              // Latin Extended-A
+              "\xC5\x92" => '&OElig;',
+              "\xC5\x93" => '&oelig;',
+              "\xC5\xA0" => '&Scaron;',
+              "\xC5\xA1" => '&scaron;',
+              "\xC5\xB8" => '&Yuml;',
+              // Spacing Modifier Letters
+              "\xCB\x86" => '&circ;',
+              "\xCB\x9C" => '&tilde;',
+              // General Punctuation
+              "\xE2\x80\x82" => '&ensp;',
+              "\xE2\x80\x83" => '&emsp;',
+              "\xE2\x80\x89" => '&thinsp;',
+              "\xE2\x80\x8C" => '&zwnj;',
+              "\xE2\x80\x8D" => '&zwj;',
+              "\xE2\x80\x8E" => '&lrm;',
+              "\xE2\x80\x8F" => '&rlm;',
+              "\xE2\x80\x93" => '&ndash;',
+              "\xE2\x80\x94" => '&mdash;',
+              "\xE2\x80\x98" => '&lsquo;',
+              "\xE2\x80\x99" => '&rsquo;',
+              "\xE2\x80\x9A" => '&sbquo;',
+              "\xE2\x80\x9C" => '&ldquo;',
+              "\xE2\x80\x9D" => '&rdquo;',
+              "\xE2\x80\x9E" => '&bdquo;',
+              "\xE2\x80\xA0" => '&dagger;',
+              "\xE2\x80\xA1" => '&Dagger;',
+              "\xE2\x80\xB0" => '&permil;',
+              "\xE2\x80\xB9" => '&lsaquo;',
+              "\xE2\x80\xBA" => '&rsaquo;',
+              "\xE2\x82\xAC" => '&euro;',
+              // Latin Extended-B
+              "\xC6\x92" => '&fnof;',
+              // Greek
+              "\xCE\x91" => '&Alpha;',
+              "\xCE\x92" => '&Beta;',
+              "\xCE\x93" => '&Gamma;',
+              "\xCE\x94" => '&Delta;',
+              "\xCE\x95" => '&Epsilon;',
+              "\xCE\x96" => '&Zeta;',
+              "\xCE\x97" => '&Eta;',
+              "\xCE\x98" => '&Theta;',
+              "\xCE\x99" => '&Iota;',
+              "\xCE\x9A" => '&Kappa;',
+              "\xCE\x9B" => '&Lambda;',
+              "\xCE\x9C" => '&Mu;',
+              "\xCE\x9D" => '&Nu;',
+              "\xCE\x9E" => '&Xi;',
+              "\xCE\x9F" => '&Omicron;',
+              "\xCE\xA0" => '&Pi;',
+              "\xCE\xA1" => '&Rho;',
+              "\xCE\xA3" => '&Sigma;',
+              "\xCE\xA4" => '&Tau;',
+              "\xCE\xA5" => '&Upsilon;',
+              "\xCE\xA6" => '&Phi;',
+              "\xCE\xA7" => '&Chi;',
+              "\xCE\xA8" => '&Psi;',
+              "\xCE\xA9" => '&Omega;',
+              "\xCE\xB1" => '&alpha;',
+              "\xCE\xB2" => '&beta;',
+              "\xCE\xB3" => '&gamma;',
+              "\xCE\xB4" => '&delta;',
+              "\xCE\xB5" => '&epsilon;',
+              "\xCE\xB6" => '&zeta;',
+              "\xCE\xB7" => '&eta;',
+              "\xCE\xB8" => '&theta;',
+              "\xCE\xB9" => '&iota;',
+              "\xCE\xBA" => '&kappa;',
+              "\xCE\xBB" => '&lambda;',
+              "\xCE\xBC" => '&mu;',
+              "\xCE\xBD" => '&nu;',
+              "\xCE\xBE" => '&xi;',
+              "\xCE\xBF" => '&omicron;',
+              "\xCF\x80" => '&pi;',
+              "\xCF\x81" => '&rho;',
+              "\xCF\x82" => '&sigmaf;',
+              "\xCF\x83" => '&sigma;',
+              "\xCF\x84" => '&tau;',
+              "\xCF\x85" => '&upsilon;',
+              "\xCF\x86" => '&phi;',
+              "\xCF\x87" => '&chi;',
+              "\xCF\x88" => '&psi;',
+              "\xCF\x89" => '&omega;',
+              "\xCF\x91" => '&thetasym;',
+              "\xCF\x92" => '&upsih;',
+              "\xCF\x96" => '&piv;',
+              // General Punctuation
+              "\xE2\x80\xA2" => '&bull;',
+              "\xE2\x80\xA6" => '&hellip;',
+              "\xE2\x80\xB2" => '&prime;',
+              "\xE2\x80\xB3" => '&Prime;',
+              "\xE2\x80\xBE" => '&oline;',
+              "\xE2\x81\x84" => '&frasl;',
+              // Letterlike Symbols
+              "\xE2\x84\x98" => '&weierp;',
+              "\xE2\x84\x91" => '&image;',
+              "\xE2\x84\x9C" => '&real;',
+              "\xE2\x84\xA2" => '&trade;',
+              "\xE2\x84\xB5" => '&alefsym;',
+              // Arrows
+              "\xE2\x86\x90" => '&larr;',
+              "\xE2\x86\x91" => '&uarr;',
+              "\xE2\x86\x92" => '&rarr;',
+              "\xE2\x86\x93" => '&darr;',
+              "\xE2\x86\x94" => '&harr;',
+              "\xE2\x86\xB5" => '&crarr;',
+              "\xE2\x87\x90" => '&lArr;',
+              "\xE2\x87\x91" => '&uArr;',
+              "\xE2\x87\x92" => '&rArr;',
+              "\xE2\x87\x93" => '&dArr;',
+              "\xE2\x87\x94" => '&hArr;',
+              // Mathematical Operators
+              "\xE2\x88\x80" => '&forall;',
+              "\xE2\x88\x82" => '&part;',
+              "\xE2\x88\x83" => '&exist;',
+              "\xE2\x88\x85" => '&empty;',
+              "\xE2\x88\x87" => '&nabla;',
+              "\xE2\x88\x88" => '&isin;',
+              "\xE2\x88\x89" => '&notin;',
+              "\xE2\x88\x8B" => '&ni;',
+              "\xE2\x88\x8F" => '&prod;',
+              "\xE2\x88\x91" => '&sum;',
+              "\xE2\x88\x92" => '&minus;',
+              "\xE2\x88\x97" => '&lowast;',
+              "\xE2\x88\x9A" => '&radic;',
+              "\xE2\x88\x9D" => '&prop;',
+              "\xE2\x88\x9E" => '&infin;',
+              "\xE2\x88\xA0" => '&ang;',
+              "\xE2\x88\xA7" => '&and;',
+              "\xE2\x88\xA8" => '&or;',
+              "\xE2\x88\xA9" => '&cap;',
+              "\xE2\x88\xAA" => '&cup;',
+              "\xE2\x88\xAB" => '&int;',
+              "\xE2\x88\xB4" => '&there4;',
+              "\xE2\x88\xBC" => '&sim;',
+              "\xE2\x89\x85" => '&cong;',
+              "\xE2\x89\x88" => '&asymp;',
+              "\xE2\x89\xA0" => '&ne;',
+              "\xE2\x89\xA1" => '&equiv;',
+              "\xE2\x89\xA4" => '&le;',
+              "\xE2\x89\xA5" => '&ge;',
+              "\xE2\x8A\x82" => '&sub;',
+              "\xE2\x8A\x83" => '&sup;',
+              "\xE2\x8A\x84" => '&nsub;',
+              "\xE2\x8A\x86" => '&sube;',
+              "\xE2\x8A\x87" => '&supe;',
+              "\xE2\x8A\x95" => '&oplus;',
+              "\xE2\x8A\x97" => '&otimes;',
+              "\xE2\x8A\xA5" => '&perp;',
+              "\xE2\x8B\x85" => '&sdot;',
+              // Miscellaneous Technical
+              "\xE2\x8C\x88" => '&lceil;',
+              "\xE2\x8C\x89" => '&rceil;',
+              "\xE2\x8C\x8A" => '&lfloor;',
+              "\xE2\x8C\x8B" => '&rfloor;',
+              "\xE2\x8C\xA9" => '&lang;',
+              "\xE2\x8C\xAA" => '&rang;',
+              // Geometric Shapes
+              "\xE2\x97\x8A" => '&loz;',
+              // Miscellaneous Symbols
+              "\xE2\x99\xA0" => '&spades;',
+              "\xE2\x99\xA3" => '&clubs;',
+              "\xE2\x99\xA5" => '&hearts;',
+              "\xE2\x99\xA6" => '&diams;'
+              )
        );
 ?>

+ 4 - 4
functions/i18n.php

@@ -200,7 +200,7 @@ function charset_convert($in_charset,$string,$out_charset,$htmlencode=true) {
  * @return string $charset Adjusted name of charset
  */
 function fixcharset($charset) {
-    /* remove minus and characters that might be used in paths from charset 
+    /* remove minus and characters that might be used in paths from charset
      * name in order to be able to use it in function names and include calls.
      */
     $charset=preg_replace("/[-:.\/\\\]/",'_',$charset);
@@ -299,8 +299,8 @@ function set_up_language($sm_language, $do_search = false, $default = false) {
         }
         setlocale(LC_ALL, $longlocale);
         // Workaround for plugins that use numbers with floating point
-        // It might be removed if plugins use correct decimal delimiters 
-	// according to locale settings.
+        // It might be removed if plugins use correct decimal delimiters
+        // according to locale settings.
         setlocale(LC_NUMERIC, 'C');
         // Workaround for specific Turkish strtolower/strtoupper rules.
         // Many functions expect English conversion rules.
@@ -717,7 +717,7 @@ function is_conversion_safe($input_charset) {
   global $languages, $sm_notAlias, $default_charset, $lossy_encoding;
 
     if (isset($lossy_encoding) && $lossy_encoding )
-	return true;
+        return true;
 
  // convert to lower case
  $input_charset = strtolower($input_charset);

+ 19 - 19
functions/imap_asearch.php

@@ -33,7 +33,7 @@ $imap_asearch_debug_dump = FALSE;
 */
 global $imap_asearch_opcodes;
 $imap_asearch_opcodes = array(
-/* <sequence-set> => 'asequence', */	// Special handling, @see sqimap_asearch_build_criteria()
+/* <sequence-set> => 'asequence', */    // Special handling, @see sqimap_asearch_build_criteria()
 /*'ALL' is binary operator */
     'ANSWERED' => '',
     'BCC' => 'astring',
@@ -44,7 +44,7 @@ $imap_asearch_opcodes = array(
     'DRAFT' => '',
     'FLAGGED' => '',
     'FROM' => 'astring',
-    'HEADER' => 'afield',	// Special syntax for this one, @see sqimap_asearch_build_criteria()
+    'HEADER' => 'afield',    // Special syntax for this one, @see sqimap_asearch_build_criteria()
     'KEYWORD' => 'akeyword',
     'LARGER' => 'anum',
     'NEW' => '',
@@ -123,7 +123,7 @@ function sqimap_asearch_error_box($response, $query, $message, $link = '')
         $message_title = _("Possible reason : ");
     if (function_exists('sqimap_error_box'))
         sqimap_error_box($title, $query, $message_title, $message, $link);
-    else {	//Straight copy of 1.5 imap_general.php:sqimap_error_box(). Can be removed at a later time
+    else {    //Straight copy of 1.5 imap_general.php:sqimap_error_box(). Can be removed at a later time
         global $color;
     require_once(SM_PATH . 'functions/display_messages.php');
     $string = "<font color=\"$color[2]\"><b>\n" . $title . "</b><br />\n";
@@ -161,7 +161,7 @@ function asearch_nz(&$var, $def = '')
 */
 function asearch_unhtmlentities($string) {
     $trans_tbl = array_flip(get_html_translation_table(HTML_ENTITIES));
-    for ($i=127; $i<255; $i++)	/* Add &#<dec>; entities */
+    for ($i=127; $i<255; $i++)    /* Add &#<dec>; entities */
         $trans_tbl['&#' . $i . ';'] = chr($i);
     return strtr($string, $trans_tbl);
 /* I think the one above is quicker, though it should be benchmarked
@@ -180,8 +180,8 @@ function s_debug_dump($var_name, $var_var)
 {
     global $imap_asearch_debug_dump;
     if ($imap_asearch_debug_dump) {
-        if (function_exists('sm_print_r'))	//Only exists since 1.4.2
-            sm_print_r($var_name, $var_var);	//Better be the 'varargs' version ;)
+        if (function_exists('sm_print_r'))      //Only exists since 1.4.2
+            sm_print_r($var_name, $var_var);    //Better be the 'varargs' version ;)
         else {
             echo '<pre>';
             echo htmlentities($var_name);
@@ -194,21 +194,21 @@ function s_debug_dump($var_name, $var_var)
 /** Encode a string to quoted or literal as defined in rfc 3501
 *
 * -  4.3 String:
-*	A quoted string is a sequence of zero or more 7-bit characters,
-*	 excluding CR and LF, with double quote (<">) characters at each end.
+*        A quoted string is a sequence of zero or more 7-bit characters,
+*         excluding CR and LF, with double quote (<">) characters at each end.
 * -  9. Formal Syntax:
-*	quoted-specials = DQUOTE / "\"
+*        quoted-specials = DQUOTE / "\"
 * @param string $what string to encode
 * @param string $charset search charset used
 * @return string encoded string
 */
 function sqimap_asearch_encode_string($what, $charset)
 {
-    if (strtoupper($charset) == 'ISO-2022-JP')	// This should be now handled in imap_utf7_local?
+    if (strtoupper($charset) == 'ISO-2022-JP')    // This should be now handled in imap_utf7_local?
         $what = mb_convert_encoding($what, 'JIS', 'auto');
     if (preg_match('/["\\\\\r\n\x80-\xff]/', $what))
-        return '{' . strlen($what) . "}\r\n" . $what;	// 4.3 literal form
-    return '"' . $what . '"';	// 4.3 quoted string form
+        return '{' . strlen($what) . "}\r\n" . $what;    // 4.3 literal form
+    return '"' . $what . '"';    // 4.3 quoted string form
 }
 
 /**
@@ -232,7 +232,7 @@ function sqimap_asearch_parse_date($what)
         preg_match('/^([0-9]+)-+([^\-]+)-+([0-9]+)$/', $what, $what_parts);
         if (count($what_parts) == 4) {
             $what_month = strtolower(asearch_unhtmlentities($what_parts[2]));
-/*		if (!in_array($what_month, $imap_asearch_months)) {*/
+/*                if (!in_array($what_month, $imap_asearch_months)) {*/
                 foreach ($imap_asearch_months as $month_number => $month_code) {
                     if (($what_month == $month_number)
                     || ($what_month == $month_code)
@@ -244,7 +244,7 @@ function sqimap_asearch_parse_date($what)
                         break;
                     }
                 }
-/*		}*/
+/*                }*/
         }
     }
     else
@@ -285,10 +285,10 @@ function sqimap_asearch_build_criteria($opcode, $what, $charset)
                 $criteria = $opcode . ' ' . $what . ' ';
             }
         break;
-        case '':	//aflag
+        case '':    //aflag
             $criteria = $opcode . ' ';
         break;
-        case 'afield':	/* HEADER field-name: field-body */
+        case 'afield':    /* HEADER field-name: field-body */
             preg_match('/^([^:]+):(.*)$/', $what, $what_parts);
             if (count($what_parts) == 3)
                 $criteria = $opcode . ' ' .
@@ -364,7 +364,7 @@ function sqimap_run_search($imapConnection, $search_string, $search_charset)
     }
     $messagelist = parseUidList($readin,'SEARCH');
 
-    if (empty($messagelist))	//Empty search response, ie '* SEARCH'
+    if (empty($messagelist))    //Empty search response, ie '* SEARCH'
         return array();
 
     $cnt = count($messagelist);
@@ -449,13 +449,13 @@ function sqimap_asearch($imapConnection, &$mailbox_array, &$biop_array, &$unop_a
     $mbox_search = array();
     $search_string = '';
     $cur_mailbox = $mailbox_array[0];
-    $cur_biop = '';	/* Start with ALL */
+    $cur_biop = '';    /* Start with ALL */
     /* We loop one more time than the real array count, so the last search gets fired */
     for ($cur_crit=0,$iCnt=count($where_array); $cur_crit <= $iCnt; ++$cur_crit) {
         if (empty($exclude_array[$cur_crit])) {
             $next_mailbox = (isset($mailbox_array[$cur_crit])) ? $mailbox_array[$cur_crit] : false;
             if ($next_mailbox != $cur_mailbox) {
-                $search_string = trim($search_string);	/* Trim out last space */
+                $search_string = trim($search_string);    /* Trim out last space */
                 if ($cur_mailbox == 'All Folders')
                     $search_mboxes = $mboxes_array;
                 else if ((!empty($sub_array[$cur_crit - 1])) || (!in_array($cur_mailbox, $mboxes_array)))

+ 6 - 6
functions/imap_general.php

@@ -72,7 +72,7 @@ function sqimap_run_command ($imap_stream, $query, $handle_errors, &$response,
 
         $read = sqimap_read_data ($imap_stream, $tag, $handle_errors, $response,
                                   $message, $query,$filter,$outputstream,$no_return);
-        if (empty($read)) {	//Imap server dropped its connection
+        if (empty($read)) {    //Imap server dropped its connection
             $response = '';
             $message = '';
             return false;
@@ -816,7 +816,7 @@ function sqimap_get_delimiter ($imap_stream = false) {
         } else {
             fputs ($imap_stream, ". LIST \"INBOX\" \"\"\r\n");
             $read = sqimap_read_data($imap_stream, '.', true, $a, $b);
-            $read = $read['.'][0];	//sqimap_read_data() now returns a tag array of response array
+            $read = $read['.'][0];    //sqimap_read_data() now returns a tag array of response array
             $quote_position = strpos ($read[0], '"');
             $sqimap_delimiter = substr ($read[0], $quote_position+1, 1);
         }
@@ -831,9 +831,9 @@ function sqimap_get_delimiter ($imap_stream = false) {
  */
 function sqimap_encode_mailbox_name($what)
 {
-	if (ereg("[\"\\\r\n]", $what))
-		return '{' . strlen($what) . "}\r\n" . $what;	/* 4.3 literal form */
-	return '"' . $what . '"';	/* 4.3 quoted string form */
+    if (ereg("[\"\\\r\n]", $what))
+        return '{' . strlen($what) . "}\r\n" . $what;        /* 4.3 literal form */
+    return '"' . $what . '"';        /* 4.3 quoted string form */
 }
 
 /**
@@ -989,4 +989,4 @@ function map_yp_alias($username) {
    return chop(substr($yp, strlen($username)+1));
 }
 
-?>
+?>

+ 2 - 2
functions/imap_mailbox.php

@@ -376,7 +376,7 @@ function sqimap_mailbox_rename( $imap_stream, $old_name, $new_name ) {
 
         $boxesall = sqimap_mailbox_list($imap_stream);
         $cmd = 'RENAME ' . sqimap_encode_mailbox_name($old_name) .
-	             ' ' . sqimap_encode_mailbox_name($new_name);
+                     ' ' . sqimap_encode_mailbox_name($new_name);
         $data = sqimap_run_command($imap_stream, $cmd, true, $response, $message);
         sqimap_unsubscribe($imap_stream, $old_name.$postfix);
         $oldpref = getPref($data_dir, $username, 'thread_'.$old_name.$postfix);
@@ -1050,4 +1050,4 @@ function sqimap_get_status_mbx_tree($imap_stream,&$mbx_tree) {
     }
 }
 
-?>
+?>

+ 1 - 1
functions/imap_search.php

@@ -25,7 +25,7 @@ function sqimap_search($imapConnection, $search_where, $search_what, $mailbox,
                        $color, $search_position = '', $search_all, $count_all) {
 
     global $squirrelmail_language, $languages, $pos, $allow_charset_search,
-	       $imap_server_type;
+           $imap_server_type;
 
     $pos = $search_position;
 

+ 160 - 160
functions/imap_utf7_local.php

@@ -22,205 +22,205 @@
  */
 function sqimap_mb_convert_encoding($str, $to_encoding, $from_encoding, $default_charset)
 {
-  // Allows mbstring functions only with iso-8859-*, utf-8 and
-  // iso-2022-jp (Japanese)
-  // koi8-r and gb2312 can be added only in php 4.3+
-  if ( stristr($default_charset, 'iso-8859-') ||
-       stristr($default_charset, 'utf-8') ||
-       stristr($default_charset, 'iso-2022-jp') ) {
-    if (function_exists('mb_convert_encoding')) {
-      return mb_convert_encoding($str, $to_encoding, $from_encoding);
+    // Allows mbstring functions only with iso-8859-*, utf-8 and
+    // iso-2022-jp (Japanese)
+    // koi8-r and gb2312 can be added only in php 4.3+
+    if ( stristr($default_charset, 'iso-8859-') ||
+            stristr($default_charset, 'utf-8') ||
+            stristr($default_charset, 'iso-2022-jp') ) {
+        if (function_exists('mb_convert_encoding')) {
+            return mb_convert_encoding($str, $to_encoding, $from_encoding);
+        }
     }
-  }
-  return '';
+    return '';
 }
 
 function imap_utf7_encode_local($s) {
     global $languages, $squirrelmail_language;
 
     if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
-        function_exists($languages[$squirrelmail_language]['XTRA_CODE'].'_utf7_imap_encode')) {
+            function_exists($languages[$squirrelmail_language]['XTRA_CODE'].'_utf7_imap_encode')) {
         return call_user_func($languages[$squirrelmail_language]['XTRA_CODE'] . '_utf7_imap_encode', $s);
     }
 
-    if ($s == '')  //If empty, don't bother
-      return '';
+    if ($s == '')    //If empty, don't bother
+        return '';
 
     global $default_charset;
-    set_my_charset();	//must be called before using $default_charset
+    set_my_charset();    //must be called before using $default_charset
     if ((strtolower($default_charset) != 'iso-8859-1') && ($default_charset != '')) {
-      $utf7_s = sqimap_mb_convert_encoding($s, 'UTF7-IMAP', $default_charset, $default_charset);
-      if ($utf7_s != '')
-        return $utf7_s;
+        $utf7_s = sqimap_mb_convert_encoding($s, 'UTF7-IMAP', $default_charset, $default_charset);
+        if ($utf7_s != '')
+            return $utf7_s;
     }
 
     // Later code works only for ISO-8859-1
 
-	$b64_s = '';	// buffer for substring to be base64-encoded
-	$utf7_s = '';	// imap-utf7-encoded string
-	for ($i = 0; $i < strlen($s); $i++) {
-		$c = $s[$i];
-		$ord_c = ord($c);
-		if ((($ord_c >= 0x20) and ($ord_c <= 0x25)) or
-		    (($ord_c >= 0x27) and ($ord_c <= 0x7e))) {
-			if ($b64_s) {
-				$utf7_s = $utf7_s . '&' . encodeBASE64($b64_s) .'-';
-				$b64_s = '';
-			}
-			$utf7_s = $utf7_s . $c;
-		} elseif ($ord_c == 0x26) {
-			if ($b64_s) {
-				$utf7_s = $utf7_s . '&' . encodeBASE64($b64_s) . '-';
-				$b64_s = '';
-			}
-			$utf7_s = $utf7_s . '&-';
-		} else {
-			$b64_s = $b64_s . chr(0) . $c;
-		}
-	}
-	//
-	// flush buffer
-	//
-	if ($b64_s) {
-		$utf7_s = $utf7_s . '&' . encodeBASE64($b64_s) . '-';
-		$b64_s = '';
-	}
-	return $utf7_s;
+    $b64_s = '';     // buffer for substring to be base64-encoded
+    $utf7_s = '';    // imap-utf7-encoded string
+    for ($i = 0; $i < strlen($s); $i++) {
+        $c = $s[$i];
+        $ord_c = ord($c);
+        if ((($ord_c >= 0x20) and ($ord_c <= 0x25)) or
+                (($ord_c >= 0x27) and ($ord_c <= 0x7e))) {
+            if ($b64_s) {
+                $utf7_s = $utf7_s . '&' . encodeBASE64($b64_s) .'-';
+                $b64_s = '';
+            }
+            $utf7_s = $utf7_s . $c;
+        } elseif ($ord_c == 0x26) {
+            if ($b64_s) {
+                $utf7_s = $utf7_s . '&' . encodeBASE64($b64_s) . '-';
+                $b64_s = '';
+            }
+            $utf7_s = $utf7_s . '&-';
+        } else {
+            $b64_s = $b64_s . chr(0) . $c;
+        }
+    }
+    //
+    // flush buffer
+    //
+    if ($b64_s) {
+        $utf7_s = $utf7_s . '&' . encodeBASE64($b64_s) . '-';
+        $b64_s = '';
+    }
+    return $utf7_s;
 }
 
 function imap_utf7_decode_local($s) {
     global $languages, $squirrelmail_language;
 
     if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
-        function_exists($languages[$squirrelmail_language]['XTRA_CODE'] . '_utf7_imap_decode')) {
+            function_exists($languages[$squirrelmail_language]['XTRA_CODE'] . '_utf7_imap_decode')) {
         return call_user_func($languages[$squirrelmail_language]['XTRA_CODE'] . '_utf7_imap_decode', $s);
     }
 
-    if ($s == '')  //If empty, don't bother
-      return '';
+    if ($s == '')    //If empty, don't bother
+        return '';
 
     global $default_charset;
-    set_my_charset();	//must be called before using $default_charset
+    set_my_charset();    //must be called before using $default_charset
     if ((strtolower($default_charset) != 'iso-8859-1') && ($default_charset != '')) {
-      $utf7_s = sqimap_mb_convert_encoding($s, $default_charset, 'UTF7-IMAP', $default_charset);
-      if ($utf7_s != '')
-        return $utf7_s;
+        $utf7_s = sqimap_mb_convert_encoding($s, $default_charset, 'UTF7-IMAP', $default_charset);
+        if ($utf7_s != '')
+            return $utf7_s;
     }
 
     // Later code works only for ISO-8859-1
 
-	$b64_s = '';
-	$iso_8859_1_s = '';
-	for ($i = 0, $len = strlen($s); $i < $len; $i++) {
-		$c = $s[$i];
-		if (strlen($b64_s) > 0) {
-			if ($c == '-') {
-				if ($b64_s == '&') {
-					$iso_8859_1_s = $iso_8859_1_s . '&';
-				} else {
-					$iso_8859_1_s = $iso_8859_1_s .
-					  decodeBASE64(substr($b64_s, 1));
-				}
-				$b64_s = '';
-			} else {
-				$b64_s = $b64_s . $c;
-			}
-		} else {
-			if ($c == '&') {
-				$b64_s = '&';
-			} else {
-				$iso_8859_1_s = $iso_8859_1_s . $c;
-			}
-		}
-	}
-	return $iso_8859_1_s;
+    $b64_s = '';
+    $iso_8859_1_s = '';
+    for ($i = 0, $len = strlen($s); $i < $len; $i++) {
+        $c = $s[$i];
+        if (strlen($b64_s) > 0) {
+            if ($c == '-') {
+                if ($b64_s == '&') {
+                    $iso_8859_1_s = $iso_8859_1_s . '&';
+                } else {
+                    $iso_8859_1_s = $iso_8859_1_s .
+                        decodeBASE64(substr($b64_s, 1));
+                }
+                $b64_s = '';
+            } else {
+                $b64_s = $b64_s . $c;
+            }
+        } else {
+            if ($c == '&') {
+                $b64_s = '&';
+            } else {
+                $iso_8859_1_s = $iso_8859_1_s . $c;
+            }
+        }
+    }
+    return $iso_8859_1_s;
 }
 
 function encodeBASE64($s) {
-	$B64Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,';
-	$p = 0;		// phase: 1 / 2 / 3 / 1 / 2 / 3...
-	$e = '';	// base64-encoded string
-	//foreach($s as $c) {
-	for ($i = 0; $i < strlen($s); $i++) {
-		$c = $s[$i];
-		if ($p == 0) {
-			$e = $e . substr($B64Chars, ((ord($c) & 252) >> 2), 1);
-			$t = (ord($c) & 3);
-			$p = 1;
-		} elseif ($p == 1) {
-			$e = $e . $B64Chars[($t << 4) + ((ord($c) & 240) >> 4)];
-			$t = (ord($c) & 15);
-			$p = 2;
-		} elseif ($p == 2) {
-			$e = $e . $B64Chars[($t << 2) + ((ord($c) & 192) >> 6)];
-			$e = $e . $B64Chars[ord($c) & 63];
-			$p = 0;
-		}
-	}
-	//
-	// flush buffer
-	//
-	if ($p == 1) {
-		$e = $e . $B64Chars[$t << 4];
-	} elseif ($p == 2) {
-		$e = $e . $B64Chars[$t << 2];
-	}
-	return $e;
+    $B64Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,';
+    $p = 0;     // phase: 1 / 2 / 3 / 1 / 2 / 3...
+    $e = '';    // base64-encoded string
+    //foreach($s as $c) {
+    for ($i = 0; $i < strlen($s); $i++) {
+        $c = $s[$i];
+        if ($p == 0) {
+            $e = $e . substr($B64Chars, ((ord($c) & 252) >> 2), 1);
+            $t = (ord($c) & 3);
+            $p = 1;
+        } elseif ($p == 1) {
+            $e = $e . $B64Chars[($t << 4) + ((ord($c) & 240) >> 4)];
+            $t = (ord($c) & 15);
+            $p = 2;
+        } elseif ($p == 2) {
+            $e = $e . $B64Chars[($t << 2) + ((ord($c) & 192) >> 6)];
+            $e = $e . $B64Chars[ord($c) & 63];
+            $p = 0;
+        }
+    }
+    //
+    // flush buffer
+    //
+    if ($p == 1) {
+        $e = $e . $B64Chars[$t << 4];
+    } elseif ($p == 2) {
+        $e = $e . $B64Chars[$t << 2];
+    }
+    return $e;
 }
 
 function decodeBASE64($s) {
-	$B64Values = array(
-		'A' =>  0, 'B' =>  1, 'C' =>  2, 'D' =>  3, 'E' =>  4, 'F' =>  5,
-		'G' =>  6, 'H' =>  7, 'I' =>  8, 'J' =>  9, 'K' => 10, 'L' => 11,
-		'M' => 12, 'N' => 13, 'O' => 14, 'P' => 15, 'Q' => 16, 'R' => 17,
-		'S' => 18, 'T' => 19, 'U' => 20, 'V' => 21, 'W' => 22, 'X' => 23,
-		'Y' => 24, 'Z' => 25,
-		'a' => 26, 'b' => 27, 'c' => 28, 'd' => 29, 'e' => 30, 'f' => 31,
-		'g' => 32, 'h' => 33, 'i' => 34, 'j' => 35, 'k' => 36, 'l' => 37,
-		'm' => 38, 'n' => 39, 'o' => 40, 'p' => 41, 'q' => 42, 'r' => 43,
-		's' => 44, 't' => 45, 'u' => 46, 'v' => 47, 'w' => 48, 'x' => 49,
-		'y' => 50, 'z' => 51,
-		'0' => 52, '1' => 53, '2' => 54, '3' => 55, '4' => 56, '5' => 57,
-		'6' => 58, '7' => 59, '8' => 60, '9' => 61, '+' => 62, ',' => 63
-	);
-	$p = 0;
-	$d = '';
-	$unicodeNullByteToggle = 0;
-	for ($i = 0, $len = strlen($s); $i < $len; $i++) {
-		$c = $s[$i];
-		if ($p == 0) {
-			$t = $B64Values[$c];
-			$p = 1;
-		} elseif ($p == 1) {
-			if ($unicodeNullByteToggle) {
-				$d = $d . chr(($t << 2) + (($B64Values[$c] & 48) >> 4));
-				$unicodeNullByteToggle = 0;
-			} else {
-				$unicodeNullByteToggle = 1;
-			}
-			$t = ($B64Values[$c] & 15);
-			$p = 2;
-		} elseif ($p == 2) {
-			if ($unicodeNullByteToggle) {
-				$d = $d . chr(($t << 4) + (($B64Values[$c] & 60) >> 2));
-				$unicodeNullByteToggle = 0;
-			} else {
-				$unicodeNullByteToggle = 1;
-			}
-			$t = ($B64Values[$c] & 3);
-			$p = 3;
-		} elseif ($p == 3) {
-			if ($unicodeNullByteToggle) {
-				$d = $d . chr(($t << 6) + $B64Values[$c]);
-				$unicodeNullByteToggle = 0;
-			} else {
-				$unicodeNullByteToggle = 1;
-			}
-			$t = ($B64Values[$c] & 3);
-			$p = 0;
-		}
-	}
-	return $d;
+    $B64Values = array(
+            'A' =>  0, 'B' =>  1, 'C' =>  2, 'D' =>  3, 'E' =>  4, 'F' =>  5,
+            'G' =>  6, 'H' =>  7, 'I' =>  8, 'J' =>  9, 'K' => 10, 'L' => 11,
+            'M' => 12, 'N' => 13, 'O' => 14, 'P' => 15, 'Q' => 16, 'R' => 17,
+            'S' => 18, 'T' => 19, 'U' => 20, 'V' => 21, 'W' => 22, 'X' => 23,
+            'Y' => 24, 'Z' => 25,
+            'a' => 26, 'b' => 27, 'c' => 28, 'd' => 29, 'e' => 30, 'f' => 31,
+            'g' => 32, 'h' => 33, 'i' => 34, 'j' => 35, 'k' => 36, 'l' => 37,
+            'm' => 38, 'n' => 39, 'o' => 40, 'p' => 41, 'q' => 42, 'r' => 43,
+            's' => 44, 't' => 45, 'u' => 46, 'v' => 47, 'w' => 48, 'x' => 49,
+            'y' => 50, 'z' => 51,
+            '0' => 52, '1' => 53, '2' => 54, '3' => 55, '4' => 56, '5' => 57,
+            '6' => 58, '7' => 59, '8' => 60, '9' => 61, '+' => 62, ',' => 63
+            );
+    $p = 0;
+    $d = '';
+    $unicodeNullByteToggle = 0;
+    for ($i = 0, $len = strlen($s); $i < $len; $i++) {
+        $c = $s[$i];
+        if ($p == 0) {
+            $t = $B64Values[$c];
+            $p = 1;
+        } elseif ($p == 1) {
+            if ($unicodeNullByteToggle) {
+                $d = $d . chr(($t << 2) + (($B64Values[$c] & 48) >> 4));
+                $unicodeNullByteToggle = 0;
+            } else {
+                $unicodeNullByteToggle = 1;
+            }
+            $t = ($B64Values[$c] & 15);
+            $p = 2;
+        } elseif ($p == 2) {
+            if ($unicodeNullByteToggle) {
+                $d = $d . chr(($t << 4) + (($B64Values[$c] & 60) >> 2));
+                $unicodeNullByteToggle = 0;
+            } else {
+                $unicodeNullByteToggle = 1;
+            }
+            $t = ($B64Values[$c] & 3);
+            $p = 3;
+        } elseif ($p == 3) {
+            if ($unicodeNullByteToggle) {
+                $d = $d . chr(($t << 6) + $B64Values[$c]);
+                $unicodeNullByteToggle = 0;
+            } else {
+                $unicodeNullByteToggle = 1;
+            }
+            $t = ($B64Values[$c] & 3);
+            $p = 0;
+        }
+    }
+    return $d;
 }
 
 ?>

+ 2 - 2
functions/mailbox_display.php

@@ -1498,7 +1498,7 @@ function get_selectall_link($aMailbox) {
             $result = preg_replace("/checkall=(\d)/","checkall=$checkall_val",$result);
         }
 
-        // FIXME: I suspect that search pages use different variables in 1.5.1cvs 
+        // FIXME: I suspect that search pages use different variables in 1.5.1cvs
         // and these variables are present in $PHP_SELF.
         if (isset($aMailbox['SEARCH']) && isset($aMailbox['SEARCH'][0]) && ! sqgetGlobalVar('where',$tmp,SQ_GET)) {
             $result .= '&amp;where=' . urlencode($aMailbox['SEARCH'][0]);
@@ -2067,7 +2067,7 @@ function handleMessageListForm($imapConnection,&$aMailbox,$sButton='',$aUid = ar
                 if (($aMailbox['PAGEOFFSET']-1) >= $aMailbox['EXISTS']) {
                     $aMailbox['PAGEOFFSET'] = ($aMailbox['PAGEOFFSET'] > $aMailbox['LIMIT']) ?
                         $aMailbox['PAGEOFFSET'] - $aMailbox['LIMIT'] : 1;
-                    $aMailbox['OFFSET'] = $aMailbox['PAGEOFFSET'] - 1 ; 
+                    $aMailbox['OFFSET'] = $aMailbox['PAGEOFFSET'] - 1 ;
                 }
             }
         }

+ 2 - 2
functions/page_header.php

@@ -38,7 +38,7 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = true
 
     if ($frames) {
         echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">';
-    } else {          
+    } else {
         echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
     }
     echo "\n\n" . html_tag( 'html' ,'' , '', '', 'lang="'.$squirrelmail_language.'"' ) . "\n<head>\n";
@@ -302,7 +302,7 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
     echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\" $onload>\n\n";
     /** Here is the header and wrapping table **/
     $shortBoxName = htmlspecialchars(imap_utf7_decode_local(
-		      readShortMailboxName($mailbox, $delimiter)));
+                readShortMailboxName($mailbox, $delimiter)));
     if ( $shortBoxName == 'INBOX' ) {
         $shortBoxName = _("INBOX");
     }

+ 1 - 1
functions/plugin.php

@@ -199,4 +199,4 @@ if (isset($plugins) && is_array($plugins)) {
     }
 }
 
-?>
+?>

+ 4 - 4
functions/strings.php

@@ -977,7 +977,7 @@ function sq_htmlentities($string,$quote_style=ENT_COMPAT,$charset='us-ascii') {
  * Tests if string contains 8bit symbols.
  *
  * If charset is not set, function defaults to default_charset.
- * $default_charset global must be set correctly if $charset is 
+ * $default_charset global must be set correctly if $charset is
  * not used.
  * @param string $string tested string
  * @param string $charset charset used in a string
@@ -991,7 +991,7 @@ function sq_is8bit($string,$charset='') {
 
     /**
      * Don't use \240 in ranges. Sometimes RH 7.2 doesn't like it.
-     * Don't use \200-\237 for iso-8859-x charsets. This ranges 
+     * Don't use \200-\237 for iso-8859-x charsets. This ranges
      * stores control symbols in those charsets.
      * Use preg_match instead of ereg in order to avoid problems
      * with mbstring overloading
@@ -1011,10 +1011,10 @@ function sq_is8bit($string,$charset='') {
  * in php 5.x. Function does not test all mbstring encodings. Only the ones
  * that might be used in SM translations.
  *
- * Supported arrays are stored in session in order to reduce number of 
+ * Supported arrays are stored in session in order to reduce number of
  * mb_internal_encoding function calls.
  *
- * If you want to test all mbstring encodings - fill $list_of_encodings 
+ * If you want to test all mbstring encodings - fill $list_of_encodings
  * array.
  * @return array list of encodings supported by mbstring
  * @since 1.5.1

+ 7 - 7
functions/url_parser.php

@@ -135,8 +135,8 @@ function parseUrl (&$body) {
         }
 
         /* If there was a token to replace, replace it */
-        if ($target_token == 'mailto:') {	// rfc 2368 (mailto URL)
-            $target_pos += 7;	//skip mailto:
+        if ($target_token == 'mailto:') {    // rfc 2368 (mailto URL)
+            $target_pos += 7;    //skip mailto:
             $end = $blength;
 
             $mailto = substr($body, $target_pos, $end-$target_pos);
@@ -146,12 +146,12 @@ function parseUrl (&$body) {
                 //sm_print_r($regs);
                 $mailto_before = $target_token . $regs[0];
                 $mailto_params = $regs[10];
-                if ($regs[1]) {	//if there is an email addr before '?', we need to merge it with the params
+                if ($regs[1]) {    //if there is an email addr before '?', we need to merge it with the params
                     $to = 'to=' . $regs[1];
-                    if (strpos($mailto_params, 'to=') > -1)	//already a 'to='
+                    if (strpos($mailto_params, 'to=') > -1)    //already a 'to='
                         $mailto_params = str_replace('to=', $to . '%2C%20', $mailto_params);
                     else {
-                        if ($mailto_params)	//already some params, append to them
+                        if ($mailto_params)    //already some params, append to them
                             $mailto_params .= '&amp;' . $to;
                         else
                             $mailto_params .= '?' . $to;
@@ -214,8 +214,8 @@ function getEmail($string) {
     /* Find all the email addresses in the body */
     while (eregi($Email_RegExp_Match, $string, $regs)) {
         $addresses[$regs[0]] = strtr($regs[0], array('&amp;' => '&'));
-       	$start = strpos($string, $regs[0]) + strlen($regs[0]);
-       	$string = substr($string, $start);
+        $start = strpos($string, $regs[0]) + strlen($regs[0]);
+        $string = substr($string, $start);
     }
 
     /* Return the first address, or an empty string if no address was found */

+ 1 - 1
help/index.php

@@ -17,4 +17,4 @@ header("Location:../index.php");
 
 /* pretty impressive huh? */
 
-?>
+?>

+ 1 - 1
images/index.php

@@ -11,4 +11,4 @@
 header("Location:../index.php");
 
 /** pretty impressive huh? **/
-?>
+?>

+ 1 - 1
images/themes/default/index.php

@@ -1,3 +1,3 @@
 <?php
 header("Location:../../../index.php");
-?>
+?>

+ 1 - 1
images/themes/default/theme.php

@@ -6,4 +6,4 @@
  * @subpackage themes
  */
     $icon_themes[] = array('NAME'=>_("Default"),'PATH'=> 'default');
-?>
+?>

+ 1 - 1
images/themes/index.php

@@ -11,4 +11,4 @@
 header("Location:../index.php");
 
 /** pretty impressive huh? **/
-?>
+?>

+ 1 - 1
images/themes/none/index.php

@@ -14,4 +14,4 @@
 header("Location: src/login.php\n\n");
 
 ?>
-<html></html>
+<html></html>

+ 1 - 1
images/themes/none/theme.php

@@ -6,4 +6,4 @@
  * @subpackage themes
  */
     $icon_themes[] = array('NAME'=>_("None"),'PATH'=> 'none');
-?>
+?>

+ 1 - 1
images/themes/xp/index.php

@@ -11,4 +11,4 @@
 header("Location:../index.php");
 
 /** pretty impressive huh? **/
-?>
+?>

+ 1 - 1
images/themes/xp/theme.php

@@ -6,4 +6,4 @@
  * @subpackage themes
  */
     $icon_themes[] = array('NAME'=>_("XP"),'PATH'=> 'xp');
-?>
+?>

+ 1 - 1
include/index.php

@@ -1,3 +1,3 @@
 <?php
 header('Location: ../index.php');
-?>
+?>

+ 1 - 1
include/options/display.php

@@ -47,7 +47,7 @@ if ($use_icons) {
  * @return array all option information
  */
 function load_optpage_data_display() {
-    global $theme, $language, $languages, 
+    global $theme, $language, $languages,
     $default_use_mdn, $squirrelmail_language, $allow_thread_sort,
     $show_alternative_names, $available_languages, $use_icons;
 

+ 1 - 1
include/options/index.php

@@ -1,3 +1,3 @@
 <?php
 header('Location: ../index.php');
-?>
+?>

+ 2 - 2
include/options/personal.php

@@ -130,7 +130,7 @@ function load_optpage_data_personal() {
             'comment' =>  $identities_link_value
         );
     }
-    
+
     if ( $tzChangeAllowed ) {
         $TZ_ARRAY[SMPREF_NONE] = _("Same as server");
         $tzfile = SM_PATH . 'locale/timezones.cfg';
@@ -161,7 +161,7 @@ function load_optpage_data_personal() {
             'posvals' => $TZ_ARRAY
         );
     }
-    
+
     /*** Load the Reply Citation Options into the array ***/
     $optgrps[SMOPT_GRP_REPLY] = _("Reply Citation Options");
     $optvals[SMOPT_GRP_REPLY] = array();

+ 11 - 11
include/validate.php

@@ -15,14 +15,14 @@
  *
  * From http://www.php.net/manual/en/language.oop.serialization.php:
  *   In case this isn't clear:
- *   In 4.2 and below: 
+ *   In 4.2 and below:
  *      session.auto_start and session objects are mutually exclusive.
  *
- * We need to load the classes before the session is started, 
- * except that the session could be started automatically 
- * via session.auto_start. So, we'll close the session, 
- * then load the classes, and reopen the session which should 
- * make everything happy.  
+ * We need to load the classes before the session is started,
+ * except that the session could be started automatically
+ * via session.auto_start. So, we'll close the session,
+ * then load the classes, and reopen the session which should
+ * make everything happy.
  *
  * ** Note this means that for the 1.3.2 release, we should probably
  * recommend that people set session.auto_start=0 to avoid this altogether.
@@ -91,16 +91,16 @@ set_up_language(getPref($data_dir, $username, 'language'));
 $timeZone = getPref($data_dir, $username, 'timezone');
 
 /* Check to see if we are allowed to set the TZ environment variable.
- * We are able to do this if ... 
+ * We are able to do this if ...
  *   safe_mode is disabled OR
  *   safe_mode_allowed_env_vars is empty (you are allowed to set any) OR
- *   safe_mode_allowed_env_vars contains TZ 
+ *   safe_mode_allowed_env_vars contains TZ
  */
 $tzChangeAllowed = (!ini_get('safe_mode')) ||
-                    !strcmp(ini_get('safe_mode_allowed_env_vars'),'') || 
-                    preg_match('/^([\w_]+,)*TZ/', ini_get('safe_mode_allowed_env_vars')); 
+                    !strcmp(ini_get('safe_mode_allowed_env_vars'),'') ||
+                    preg_match('/^([\w_]+,)*TZ/', ini_get('safe_mode_allowed_env_vars'));
 
-if ( $timeZone != SMPREF_NONE && ($timeZone != "") 
+if ( $timeZone != SMPREF_NONE && ($timeZone != "")
     && $tzChangeAllowed ) {
     putenv("TZ=".$timeZone);
 }

+ 1 - 1
index.php

@@ -14,4 +14,4 @@
 header("Location: src/login.php\n\n");
 
 ?>
-<html></html>
+<html></html>

Some files were not shown because too many files changed in this diff