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