Beispiel #1
0
 function UTF8Decode($str)
 {
     if (is_array($str)) {
         foreach ($str as $k => $v) {
             $str[$k] = LinkrHelper::UTF8Decode($v);
         }
         return $str;
     } elseif (is_string($str)) {
         if (LinkrHelper::isUTF8Encoded($str)) {
             return utf8_decode($str);
         } else {
             return $str;
         }
     } else {
         return $str;
     }
 }
Beispiel #2
0
 function UTF8Decode($str)
 {
     if (is_array($str)) {
         foreach ($str as $k => $v) {
             $str[$k] = LinkrHelper::UTF8Decode($v);
         }
         return $str;
     } elseif (is_string($str)) {
         //return LinkrHelper::isUTF8($str) ? utf8_decode($str) : $str;
         //return LinkrHelper::isUTF8($str) ? utf8_decode(htmlentities($str, ENT_COMPAT, 'UTF-8')) : $str;
         if (LinkrHelper::isUTF8Encoded($str)) {
             //$he	= (JString::strpos($str, '&') !== false && JString::strpos($str, ';') > 0);
             //$str	= $he ? $str : htmlentities($str, ENT_COMPAT, 'UTF-8');
             return utf8_decode($str);
         } else {
             return $str;
         }
     } else {
         return $str;
     }
 }