Charset issue

Hi, I run into a problem regarding charset configuration using dhtmlxConnector. Some times I got a Error Loading XML in my grid. It occurs on my Linux machine (my Windows works fine). After upgrading base_connector.php from a post here in this forum (viewtopic.php?f=19&t=15570). I had to make this changes:

base_connector.php

Line 18: private $encoding; // FCV

public function __construct($start, $end = "", [b]$encoding=""[/b]){ // FCV
	$this->start = $start;
	$this->end = $end;
	$this->type = "xml";
	[b]$this->encoding = $encoding;[/b] // FCV
}

Line 36:
public function output($name=“”, $inline=true){
ob_clean();
// FCV
$encodingtxt=“”;
if (“”!=$this->encoding)
$encodingtxt=“; charset=”.$this->encoding;
// FCV

if ($this->type == “xml”)
header("Content-type: text/xml $encodingtxt "); // FCV

	echo $this->__toString();
}

Line 540 (±):

protected function output_as_xml($res){
	$start="<?xml version='1.0' encoding='".$this->encoding."' ?>".$this->xml_start(); 
	$end=$this->render_set($res).$this->xml_end();
	
	$out = new OutputWriter($start, $end,$this->encoding); // FCV
	$this->event->trigger("beforeOutput", $this, $out);
	
	$out->output();
}

base_connector.zip (5.33 KB)

Sounds as a usefull addition.
Similar logic will be added in to the main codebase.