2

in cakephp website the page title is not replacing its special characters to corresponded utf encoded characters.To make sure i have already tried:

  • converted database to utf8_general_ci collation
  • first line of bootstrap.php: header('Content-Type: text/html; charset=utf-8');
  • core.php: Configure::write('App.encoding', 'UTF-8');
  • in database.php: 'encoding' => 'utf8' while creating database connection
  • in ajax.ctp (my site is using this layout): echo $this->Html->charset('UTF-8');
  • in header.ctp of the file for which i want to set the title: echo $title_for_layout; enclosed within the title tag.

I've tried a lot and instead doing all of this ,page title is still showing special characters.Can anyone tell me what i'm missing or anything else?

keystrokker
  • 73
  • 1
  • 6
  • 14
  • Have you also done the obvious: Save your view file that contains the utf8 chars, as "utf8 without bom"? And not as ansi. – mark Oct 14 '13 at 13:31
  • But you need decode first, not? Try using editor like Sublime Text and configure open (and create) files with UTF-8. Or, set the default encode of your editor to UTF-8 – Patrick Maciel Oct 14 '13 at 16:20

1 Answers1

0

Maybe apache is configured to serve ISO-8859-1 instead of utf-8. See: https://stackoverflow.com/a/913885/138779

Or $this->Html->charset is called after the title tag in your layout.

Community
  • 1
  • 1
tersmitten
  • 1,310
  • 1
  • 9
  • 23
  • Hi all there is no problem of utf encoding on the page because the same string i'm displaying on the page itself giving the correct result but not on the title of the page.So what can be the solution? – keystrokker Oct 15 '13 at 05:24