using sq_is8bit function instead of ereg. Code reuse and fixes some problems
[squirrelmail.git] / functions / decode / cp855.php
index 97dd27f40d236d78333393452bad0400a55e000c..160f9471042c06dc1b19723519df8c3ed88b7e88 100644 (file)
@@ -34,9 +34,8 @@ function charset_decode_cp855 ($string) {
     if (strtolower($default_charset) == 'ibm855')
         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,'ibm855'))
         return $string;
 
     $cp855 = array(