render_array and encoding

Hi,

I’m using DHTMLX Scheduler in a CodeIgniter and SQL Server project. I connecto to the SQL Server with the ODBC connector.

I get the data for the Scheduler like this:

require_once("assets/dhtmlx/dhtmlxConnector/codebase/scheduler_connector.php");
require_once("assets/dhtmlx/dhtmlxConnector/codebase/db_phpci.php");
              
$conn = new SchedulerConnector($this->db, "PHPCI");
$this->load->model('example_model');
$events = $this->example_model->get_events();
$conn->render_array($events,"ID", "Date1, Date2, Text");

But it return a bad formatted XML, with characters like: GU�RDIA

I checked the $events array with a var_dump and the characters are OK (GUÀRDIA), the problem comes from the $conn->render_array().

Both database fields and PHP files are in UTF-8.

Any ideas?

render_array doesn’t apply any post processing, it just outputs the same data wrapped in correct xml or json syntax.

Are you sure that problem is in XML ? ( Loading xml directly in browser shows the invalid character, while it is valid in var_dump ) It possible that html page itself uses non-utf encoding and as result can’t convert some Unicode character to valid glyph.