From: tokul Date: Mon, 15 Nov 2004 14:31:18 +0000 (+0000) Subject: removing default_charset tests. code can be reused in main function and X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c00bcc4dc8dd44d8bc429b2addc008db89cd685b;p=squirrelmail.git removing default_charset tests. code can be reused in main function and ldap needs option that forces decoding when default charset matches git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8377 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/decode/cp1250.php b/functions/decode/cp1250.php index e2156c63..19dd1b9c 100644 --- a/functions/decode/cp1250.php +++ b/functions/decode/cp1250.php @@ -29,11 +29,6 @@ * @return string $string Decoded string */ function charset_decode_cp1250 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'windows-1250') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'windows-1250')) return $string; diff --git a/functions/decode/cp1251.php b/functions/decode/cp1251.php index 3a0c3ac4..c27f2fb5 100644 --- a/functions/decode/cp1251.php +++ b/functions/decode/cp1251.php @@ -29,11 +29,6 @@ * @return string $string Decoded string */ function charset_decode_cp1251 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'windows-1251') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'windows-1251')) return $string; diff --git a/functions/decode/cp1252.php b/functions/decode/cp1252.php index 382381fb..ccdd174a 100644 --- a/functions/decode/cp1252.php +++ b/functions/decode/cp1252.php @@ -30,11 +30,6 @@ */ function charset_decode_cp1252 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'windows-1252') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'windows-1252')) return $string; diff --git a/functions/decode/cp1253.php b/functions/decode/cp1253.php index bc852daa..fa797870 100644 --- a/functions/decode/cp1253.php +++ b/functions/decode/cp1253.php @@ -29,11 +29,6 @@ * @return string $string Decoded string */ function charset_decode_cp1253 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'windows-1253') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'windows-1253')) return $string; diff --git a/functions/decode/cp1254.php b/functions/decode/cp1254.php index 7cfe140f..57eb6170 100644 --- a/functions/decode/cp1254.php +++ b/functions/decode/cp1254.php @@ -29,11 +29,6 @@ * @return string $string Decoded string */ function charset_decode_cp1254 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'windows-1254') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'windows-1254')) return $string; diff --git a/functions/decode/cp1255.php b/functions/decode/cp1255.php index f6c1c05f..47c8e25f 100644 --- a/functions/decode/cp1255.php +++ b/functions/decode/cp1255.php @@ -29,11 +29,6 @@ * @return string $string decoded string */ function charset_decode_cp1255 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'windows-1255') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'windows-1255')) return $string; diff --git a/functions/decode/cp1256.php b/functions/decode/cp1256.php index 3608263a..91d5c4b7 100644 --- a/functions/decode/cp1256.php +++ b/functions/decode/cp1256.php @@ -29,11 +29,6 @@ * @return string $string Decoded string */ function charset_decode_cp1256 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'windows-1256') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'windows-1256')) return $string; diff --git a/functions/decode/cp1257.php b/functions/decode/cp1257.php index 12fc82f6..57c7f38a 100644 --- a/functions/decode/cp1257.php +++ b/functions/decode/cp1257.php @@ -29,11 +29,6 @@ * @return string $string Decoded string */ function charset_decode_cp1257 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'windows-1257') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'windows-1257')) return $string; diff --git a/functions/decode/cp1258.php b/functions/decode/cp1258.php index c9b42bd3..93c60b07 100644 --- a/functions/decode/cp1258.php +++ b/functions/decode/cp1258.php @@ -29,11 +29,6 @@ * @return string $string Decoded string */ function charset_decode_cp1258 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'windows-1258') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'windows-1258')) return $string; diff --git a/functions/decode/cp855.php b/functions/decode/cp855.php index bfcd2b2b..e5f270c5 100644 --- a/functions/decode/cp855.php +++ b/functions/decode/cp855.php @@ -29,11 +29,6 @@ * @return string $string Decoded string */ function charset_decode_cp855 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'ibm855') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'ibm855')) return $string; diff --git a/functions/decode/cp866.php b/functions/decode/cp866.php index 4493333e..549bc5e1 100644 --- a/functions/decode/cp866.php +++ b/functions/decode/cp866.php @@ -31,11 +31,6 @@ * @return string $string Decoded string */ function charset_decode_cp866 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'ibm866') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'ibm866')) return $string; diff --git a/functions/decode/iso_8859_1.php b/functions/decode/iso_8859_1.php index 676122cc..08faf1c5 100644 --- a/functions/decode/iso_8859_1.php +++ b/functions/decode/iso_8859_1.php @@ -19,11 +19,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_1 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-1') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-1')) return $string; diff --git a/functions/decode/iso_8859_10.php b/functions/decode/iso_8859_10.php index e032d25d..d2a5b36c 100644 --- a/functions/decode/iso_8859_10.php +++ b/functions/decode/iso_8859_10.php @@ -46,11 +46,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_10 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-10') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-10')) return $string; diff --git a/functions/decode/iso_8859_11.php b/functions/decode/iso_8859_11.php index 3fb9e881..ba2e8874 100644 --- a/functions/decode/iso_8859_11.php +++ b/functions/decode/iso_8859_11.php @@ -46,11 +46,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_11 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-11') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-11')) return $string; diff --git a/functions/decode/iso_8859_13.php b/functions/decode/iso_8859_13.php index 02459a7c..4fbb9169 100644 --- a/functions/decode/iso_8859_13.php +++ b/functions/decode/iso_8859_13.php @@ -46,11 +46,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_13 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-13') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-13')) return $string; diff --git a/functions/decode/iso_8859_14.php b/functions/decode/iso_8859_14.php index 4306387d..b9275afd 100644 --- a/functions/decode/iso_8859_14.php +++ b/functions/decode/iso_8859_14.php @@ -47,11 +47,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_14 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-14') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-14')) return $string; diff --git a/functions/decode/iso_8859_15.php b/functions/decode/iso_8859_15.php index 7b2f3357..a7d8b538 100644 --- a/functions/decode/iso_8859_15.php +++ b/functions/decode/iso_8859_15.php @@ -47,11 +47,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_15 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-15') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-15')) return $string; diff --git a/functions/decode/iso_8859_16.php b/functions/decode/iso_8859_16.php index 5703c31e..6185a0f8 100644 --- a/functions/decode/iso_8859_16.php +++ b/functions/decode/iso_8859_16.php @@ -46,11 +46,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_16 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-16') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-16')) return $string; diff --git a/functions/decode/iso_8859_2.php b/functions/decode/iso_8859_2.php index 1ef1515b..7450569d 100644 --- a/functions/decode/iso_8859_2.php +++ b/functions/decode/iso_8859_2.php @@ -46,11 +46,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_2 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-2') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-2')) return $string; diff --git a/functions/decode/iso_8859_3.php b/functions/decode/iso_8859_3.php index b28cee66..669e4ef1 100644 --- a/functions/decode/iso_8859_3.php +++ b/functions/decode/iso_8859_3.php @@ -46,11 +46,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_3 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-3') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-3')) return $string; diff --git a/functions/decode/iso_8859_4.php b/functions/decode/iso_8859_4.php index cdd14441..ba949839 100644 --- a/functions/decode/iso_8859_4.php +++ b/functions/decode/iso_8859_4.php @@ -46,11 +46,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_4 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-4') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-4')) return $string; diff --git a/functions/decode/iso_8859_5.php b/functions/decode/iso_8859_5.php index 5d0af76a..5dedf48e 100644 --- a/functions/decode/iso_8859_5.php +++ b/functions/decode/iso_8859_5.php @@ -46,11 +46,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_5 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-5') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-5')) return $string; diff --git a/functions/decode/iso_8859_6.php b/functions/decode/iso_8859_6.php index a7201503..e8827e27 100644 --- a/functions/decode/iso_8859_6.php +++ b/functions/decode/iso_8859_6.php @@ -46,11 +46,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_6 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-6') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-6')) return $string; diff --git a/functions/decode/iso_8859_7.php b/functions/decode/iso_8859_7.php index 9e0e7017..655c1c3d 100644 --- a/functions/decode/iso_8859_7.php +++ b/functions/decode/iso_8859_7.php @@ -46,11 +46,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_7 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-7') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-7')) return $string; diff --git a/functions/decode/iso_8859_8.php b/functions/decode/iso_8859_8.php index a5668ca6..e80b9907 100644 --- a/functions/decode/iso_8859_8.php +++ b/functions/decode/iso_8859_8.php @@ -46,11 +46,6 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_8 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso8859-8') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-8')) return $string; diff --git a/functions/decode/iso_8859_9.php b/functions/decode/iso_8859_9.php index 997d8633..d32c968e 100644 --- a/functions/decode/iso_8859_9.php +++ b/functions/decode/iso_8859_9.php @@ -46,11 +46,6 @@ * @return string Decoded string */ function charset_decode_iso_8859_9 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso8859-9') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-8859-9')) return $string; diff --git a/functions/decode/iso_ir_111.php b/functions/decode/iso_ir_111.php index c391214a..025a317c 100644 --- a/functions/decode/iso_ir_111.php +++ b/functions/decode/iso_ir_111.php @@ -50,11 +50,6 @@ * @return string Decoded string */ function charset_decode_iso_ir_111 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-ir-111') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'iso-ir-111')) return $string; diff --git a/functions/decode/koi8_r.php b/functions/decode/koi8_r.php index 6da34125..3a1532e0 100644 --- a/functions/decode/koi8_r.php +++ b/functions/decode/koi8_r.php @@ -45,11 +45,6 @@ * @return string Decoded string */ function charset_decode_koi8_r ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'koi8-r') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'koi8-r')) return $string; diff --git a/functions/decode/koi8_u.php b/functions/decode/koi8_u.php index 37620763..821cc491 100644 --- a/functions/decode/koi8_u.php +++ b/functions/decode/koi8_u.php @@ -49,11 +49,6 @@ * @return string Decoded string */ function charset_decode_koi8_u ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'koi8-u') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'koi8-u')) return $string; diff --git a/functions/decode/tis_620.php b/functions/decode/tis_620.php index 6596821c..ea0697db 100644 --- a/functions/decode/tis_620.php +++ b/functions/decode/tis_620.php @@ -44,11 +44,6 @@ * @return string Decoded string */ function charset_decode_tis_620 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'tis-620') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'tis-620')) return $string; diff --git a/functions/decode/us_ascii.php b/functions/decode/us_ascii.php index ae96b309..0b599f64 100644 --- a/functions/decode/us_ascii.php +++ b/functions/decode/us_ascii.php @@ -23,11 +23,6 @@ * @return string cleaned string */ function charset_decode_us_ascii ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'us-ascii') - return $string; - // don't do decoding when there are no 8bit symbols if (! sq_is8bit($string,'us-ascii')) return $string;