Hello Everyone.

I've been battling with this for a while. Now I need some help to try to
figure this out.

I just want to show on a view accented characters or something like:

$str = "La Caña de Azúcar"

If I use PHP by itself it works fine. Ex:

$str2 = mb_convert_encoding($str, 'HTML-ENTITIES', 'UTF-8');
echo $str2
echo $str

That code on PHP returns "La Caña de Azúcar" (twice) now if do that piece of
code on Zend Framework on the controller like:

$this->view->title = $str;
$this->view->encoding = "Encoding: " . mb_detect_encoding($str);
$this->view->converted = mb_convert_encoding($str, 'HTML-ENTITIES',
mb_detect_encoding($str));

I get:

La Ca?a de Az?car
Encoding: UTF-8
La Caa de Azcar

I've set up on the view:

$this->setEncoding('UTF-8');

I have set up the header:

header('Content-Type: text/html; charset=utf-8');

No luck. Any help would be greatly appreciated.

Thank you.

Reply via email to