1

due to the migration of web content from Joomla cms in custom cms, built in CakePHP 2.5.7, I have to clean the old content, remove tons of unnecessary html tags and so on.

I make a simple shell script that reads from the old database, processing some data and is stored in a new table.

Both of them have the same db encodinig, but when processing and storing data I lose some specific character of the Croatian language (čćđš). The data is regularly saved from the web interface, and do not lose these characters. Also, if we do it through phpmyadmin.

The problem is the console / shell level.

I added the following line in a shell script:

$this->out('čćšđČĆŠĐ');

The console show the following result:

─Ź─ç┼í─Ĺ─î─ć┼á─É

How to solve this?

Thanks

UPDATE:

OS: Windows 7 Language: Croatian

UPDATE 2:

joomla db

joomla db

cakephp db

cakephp db

core.php

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

db config

public $default = array(
    'datasource' => 'Database/Mysql',
    'persistent' => false,
    'host' => 'localhost',
    'login' => 'root',
    'password' => '***********',
    'database' => '*********',
    'encoding' => 'utf8',
);

EDIT 3

I moved the code from the shell in the contoller.

test:

// Read data from joomla db base
$contents = $this->JosContent->find('all');
debug ($contents);

return the wrong result, do not display correctly letters čćđ.

  • edit: For some strange reason, if I import the whole joomla db, ČĆĐŠŽ letters are not displayed correctly, but if I import only joomla joscontent db table, I have properly display of these letters in html.

The problem remains in the console.

Salines
  • 5,674
  • 3
  • 25
  • 50