Pingpp\Util\Util::utf8 PHP Method

utf8() public static method

public static utf8 ( string | mixed $value )
$value string | mixed A string to UTF8-encode.
    public static function utf8($value)
    {
        if (is_string($value) && mb_detect_encoding($value, "UTF-8", TRUE) != "UTF-8") {
            return utf8_encode($value);
        } else {
            return $value;
        }
    }