We're living in 2004 now... perl is your friend for these kinds of things :)
[squirrelmail.git] / functions / decode / gb2312.php
index 38be0af38a94ee3794b62277773935100693a0d0..c8dacf2f66cd7439f46c38570c6a2a995a901b1e 100644 (file)
@@ -1,9 +1,9 @@
 <?php
-/*
+/**
  * decode/gb2312.php
  * $Id$
  *
- * Copyright (c) 2003 The SquirrelMail Project Team
+ * Copyright (c) 2003-2004 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * This file contains gb2312-euk decoding function that is needed to read
  * Unicode Standard, and to make copies of this file in any form for
  * internal or external distribution as long as this notice remains
  * attached.
- *
+ * @package squirrelmail
+ * @subpackage decode
+ */
+
+
+/**
+ * Decode gb2312-euk encoded string
+ * @param string $string Encoded string
+ * @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) )
@@ -7498,4 +7505,4 @@ function charset_decode_gb2312 ($string) {
     return $string;
 }
 
-?>
\ No newline at end of file
+?>