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