Hi Marc,

yesterday I again played around with this. I did not have the time to test
it thoroughly yet but it seems to work if I simply add an event listener to
doctrine which inits MySQL session with utf-8. My strategy currently is the
following:

- Database tables stay encoded using latin1
- The new ZF2 functionality uses completely utf-8
- Doctrine is initialized with utf-8:
$entityManager->getEventManager()->addEventSubscriber(new
\Doctrine\DBAL\Event\Listeners\MysqlSessionInit('utf8', 'utf8_unicode_ci'));

=> the data, especially umlauts, seem to get correctly inserted and read
from the database. Hopefully I can follow this approach not needing to write
data mappers.

Would be great to hear if this works also for you.

Would be great to hear some Database/Doctrine experts if this is a viable
and robust approach.

Best Regards
Christian



-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to