2

My mb_internal_encoding(); output remains ISO-8859-1 even when UTF-8 is set multiple times. This makes no sense. In CakePHP 3.x I got this:

    'App' => [
    'namespace' => 'App',
    'encoding' => 'utf-8',
    'base' => false,
    'dir' => 'src',
    'webroot' => 'webroot',
    'wwwRoot' => WWW_ROOT,
    // 'baseUrl' => env('SCRIPT_NAME'),
    'fullBaseUrl' => false,
    'imageBaseUrl' => 'img/',
    'cssBaseUrl' => 'css/',
    'jsBaseUrl' => 'js/',
    'paths' => [
        'plugins' => [ROOT . DS . 'plugins' . DS],
        'templates' => [APP . 'Template' . DS],
        'locales' => [APP . 'Locale' . DS],
    ],
],

On my server (Debian Wheezy) the apache2.conf file says:

AddDefaultCharset utf-8

My html file has this meta tag:

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

Even when I place this in bootstrap

header('Content-Type: text/html; charset=utf-8');

My mb_internal_encoding(); output remains ISO-8859-1

What can I do more to make the output UTF-8?

Oops D'oh
  • 941
  • 1
  • 15
  • 34
Joost
  • 418
  • 5
  • 17
  • Your database itself is using utf-8 (encoding of tables checked e.g. with PHPmyAdmin)? You added utf-8 in the [database configuration in CakePHP](http://book.cakephp.org/3.0/en/orm/database-basics.html#database-configuration)? – Oops D'oh Sep 30 '15 at 20:50
  • Yes, I did. It all shows utf-8 – Joost Sep 30 '15 at 21:50
  • So you probably have to find out where the `mb_internal_encoding` is set... [Have you checked the `php.ini` file and searched for other problems with the `mb_internal_encoding?`](http://stackoverflow.com/questions/9424760/where-does-the-default-mb-internal-encoding-value-come-from) – Oops D'oh Oct 01 '15 at 18:27

0 Answers0