0

I have created a web admin tool with the Zend framework that updates text on a website. The problem is that when "©" is entered in the admin tool, the database stores "©". When I go to re-edit the text in the admin tool only "©" is displayed as normal, but when I read the text in other situations "©" is read from the database. For example PhpMyAdmin shows "©", as do Flash textFields displaying the content.

I use the Zend Framework/PHP/MySQL. Collation is set to utf8_bin in MySQL and content type on the admin tool pages is set as follows: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

With in the bootstrap.php file: $view->doctype('HTML5'); $view->setEncoding('UTF-8');

If it shows "test©" in the database "test©" is displayed in the admin tool. If I paste "text©" directly into the database, the data is displayed as blank in the admin tool.

I need the data in the database to match what I see inside the admin tool. If I submit "test©" I don't want it to be stored as "test©"

ktamlyn
  • 4,519
  • 2
  • 30
  • 41
  • 1
    what collation are your database tables' configured to use? make sure your connection is using utf8 as well – JamesHalsall Feb 21 '14 at 18:49
  • You led me to the answer. Setting "resources.db.params.charset = utf8" in the app.ini file fixed the problem. Also found here: http://stackoverflow.com/questions/3216864/zend-db-and-encoding – ktamlyn Feb 21 '14 at 19:14

0 Answers0