using sq_is8bit function instead of ereg. Code reuse and fixes some problems
[squirrelmail.git] / functions / decode / cp1258.php
index 79b4a6c95f19151937b676c981a387a2a9aaf041..4f336e952af21d14c5d73bfc3311d681d01c6007 100644 (file)
@@ -34,9 +34,8 @@ function charset_decode_cp1258 ($string) {
     if (strtolower($default_charset) == 'windows-1258')
         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-1258'))
         return $string;
 
     $cp1258 = array(