瀏覽代碼

removing default_charset tests. code can be reused in main function and
ldap needs option that forces decoding when default charset matches

tokul 20 年之前
父節點
當前提交
70f56f06fc

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;

+ 0 - 5
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;