UTF-8 exit with CakePHP

I am trying to move some Excel data to MySQL but have encoding problems.

What I've done:

  • Export data from OpenOffice 3.1 to csv (utf-8 encoding)
  • Import into phpMyAdmin via file upload (Table encoding: 'utf8_unicode_ci')

In phpMyAdmin view, the data is displayed correctly (it uses utf-8 as a charset):

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

When I try to display data on my web page, I get a hash with a question mark in it.

System info

  • The language I'm trying to get on my page: German
  • MySQL Client Version: 5.0.32
  • My OS: MAC OS X 10.5.7
  • Server Script: CakePHP v1.2.3.8166

Regards, Benedict

+5
3

,

'encoding' => 'UTF8' 

config/database.php

+20

. " ", , ... , dev live:

(2 ), .

  • DB .
  • Cake PHP .
  • Cake PHP .

, , . , MySQL workbench, "Alter Schema...". /, .

Cake PHP \Config\database.php. , DATABASE_CONFIG ( 60) , /. :

'encoding' => 'utf8'

, HTML . app\Config\core.php( 82).

Configure::write('App.encoding', 'UTF-8');

, , .

, , .

+2

UTF-8 mysql?

SET NAMES 'UTF-8'
-1

All Articles