Bläddra i källkod

managing agresive decoding and ja_JP + utf-8.
global $default_charset will be used later by recode and iconv patches.

tokul 21 år sedan
förälder
incheckning
c607b01578
3 ändrade filer med 6 tillägg och 8 borttagningar
  1. 2 3
      functions/decode/big5.php
  2. 2 3
      functions/decode/gb2312.php
  3. 2 2
      functions/decode/utf_8.php

+ 2 - 3
functions/decode/big5.php

@@ -44,10 +44,9 @@
  * @return string $string decoded string
  */
 function charset_decode_big5 ($string) {
-    global $default_charset;
+    global $default_charset,$agresive_decoding;
 
-    if (strtolower($default_charset) == 'big5')
-        return $string;
+    if (!$agresive_decoding) return $string;
 
     /* Only do the slow convert if there are 8-bit characters */
     if (! ereg("[\200-\377]", $string))

+ 2 - 3
functions/decode/gb2312.php

@@ -44,10 +44,9 @@
  * @return string $string Decoded string
  */
 function charset_decode_gb2312 ($string) {
-    global $default_charset;
+    global $default_charset,$agresive_decoding;
 
-    if (strtolower($default_charset) == 'gb2312')
-        return $string;
+    if (!$agresive_decoding) return $string;
 
     /* Only do the slow convert if there are 8-bit characters */
     if ( ! ereg("[\241-\377]", $string) )

+ 2 - 2
functions/decode/utf_8.php

@@ -27,9 +27,9 @@
  * @return string Decoded string
  */
 function charset_decode_utf_8 ($string) {
-  global $default_charset;
+  global $default_charset,$squirrelmail_language;
 
-    if (strtolower($default_charset) == 'utf-8')
+    if ($squirrelmail_language == 'ja_JP')
         return $string;
 
     /* Only do the slow convert if there are 8-bit characters */