using sq_is8bit function instead of ereg. Code reuse and fixes some problems
[squirrelmail.git] / functions / decode / utf_8.php
index 8287b5154c0bf1181b38874063231472f2285a82..968f8924267b5326a67f27768058c53ddf282c19 100644 (file)
@@ -32,9 +32,8 @@ function charset_decode_utf_8 ($string) {
     if ($squirrelmail_language == 'ja_JP')
         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,'utf-8'))
         return $string;
 
     // decode three byte unicode characters
@@ -49,5 +48,4 @@ function charset_decode_utf_8 ($string) {
 
     return $string;
 }
-
-?>
+?>
\ No newline at end of file