� appears using character_limiter() with strip_tags() and utf-8 charset � appears using character_limiter() with strip_tags() and utf-8 charset codeigniter codeigniter

� appears using character_limiter() with strip_tags() and utf-8 charset


� replacement character used to replace an unknown or unprintable characterin php usually we solve this issue using multibyte string functions .use mb_substr with strip tags like :

mb_substr( strip_tags($text) , 0,300 ,'UTF-8' );//or what ever your charset 

or you maybe modify the codeigniter function and use Multibyte String Functions .

UPDATE

function character_limiter($str, $n = 500, $end_char = '&#8230;'){    if (mb_strlen($str) < $n)    {        return $str;    }    $str = mb_ereg_replace("\s+", ' ', str_replace(array("\r\n", "\r", "\n"), ' ', $str));    if (mb_strlen($str) <= $n)    {        return $str;    }    $out = "";    foreach (explode(' ', trim($str)) as $val)    {        $out .= $val.' ';        if (mb_strlen($out) >= $n)        {            $out = trim($out);            return (mb_strlen($out) == mb_strlen($str)) ? $out : $out.$end_char;        }    }}