using sq_is8bit function instead of ereg. Code reuse and fixes some problems
[squirrelmail.git] / functions / decode / cp1253.php
index 445a38c6d71983c3fccd17efae51b239ee100b76..ff69088d9c1f9894dd6c38429c3e416cafaf8f77 100644 (file)
@@ -34,9 +34,8 @@ function charset_decode_cp1253 ($string) {
     if (strtolower($default_charset) == 'windows-1253')
         return $string;
 
-    /* Only do the slow convert if there are 8-bit characters */
-    /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */
-    if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string) )
+    // don't do decoding when there are no 8bit symbols
+    if (! sq_is8bit($string,'windows-1253'))
         return $string;
 
     $cp1253 = array(