Hi all,
This is really tearing me apart. Any help would be greatly appreciated.
I take data from my database and echo it in XML. But something goes wrong
with encoding along the way.
- Database is mysql 5, collation utf-8, character set for connection is
utf-8.
- Zend_Db_Adapter is PdoMysql
This is some content that I have stored in my database:
test: €, µ, Ò, Ð, ¶, č, ņ, ų, ß
It should be stored OK, because in PhpMyadmin it displays nicely as it
should.
However, when I print it to screen, I see:
test: �, �, �, �, �, ?, ?, ?, �
When I wrap the string in ut8_encode it improves a little, but still not OK:
test: , µ, Ò, Ð, ¶, ?, ?, ?, ß
I print to screen directly from controller. This is my code:
$this->_helper->viewRenderer->setNoRender(true);
header('Content-type: text/xml; charset=utf-8');
echo $xmlString;
Response headers says Content-Type: text/xml; charset=utf-8, like it should.
So it seems that the problem lies somewhere between data collection from
database and printing on screen. But I'm at my wit's end here...
--
View this message in context:
http://www.nabble.com/UTF-8-from-database-tp22597212p22597212.html
Sent from the Zend Framework mailing list archive at Nabble.com.