views:

58

answers:

1

Hello !

I have got a strange problem with Zend Framework - I fetch data from MySql table that is set to utf8_general_ci.
I inserted some data with polish fonts like ś ę ż... and push that data to view (Dwoo).

    {foreach $units unit}
        <tr>
            <td>{$unit.id_unit}</td>
            <td>{$unit.name}</td>
        </tr>
    {/foreach}

If $unit.name contains polish characters - Dwoo does not echo anything - if not, it works.

I set in bootstrap

$db->query('SET NAMES utf8');
$db->query('SET CHARACTER SET utf8');

but it did not help.
I have no more ideas.

Edit:
Problem is only on localhost machine (Windows) but with remote server (Linux) it is fine.

A: 

This is really strange, I did a minimal test case which works fine for me :

$dwoo = new Dwoo();
$tpl = new Dwoo_Template_String('{$var}');
$var = 'ś ę ż.';

echo $dwoo->get($tpl, array('var'=>$var));

Output is "ś ę ż." alright.

Seldaek
It is a mysql/php configuration fault only.
hsz
Well it's weird, if you can dump it correctly before it gets into dwoo. Maybe you did your data import incorrectly locally and your data inside sql isn't actually utf8 ?
Seldaek
btw I wonder why you didn't accept my solution on http://stackoverflow.com/questions/2005673/reassign-parent-variable-in-included-dwoo-template - it seemed less hackish than dropping stuff in the env var.
Seldaek
Nothing personall - I used my solution and it works for sure even it is a bit hackish. ;)
hsz