Skip to content

Commit dc85c3f

Browse files
Merge branch 'master' of dhx.github:DHTMLX/connector-php
Conflicts: codebase/base_connector.php
2 parents 13a2331 + 4a75329 commit dc85c3f

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

codebase/base_connector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,9 @@ protected function end_run(){
700700
*/
701701
public function set_encoding($encoding){
702702
$this->encoding=$encoding;
703+
if ($this->live_update !== false) {
704+
$this->live_update->set_encoding($this->encoding);
705+
}
703706
}
704707

705708
/*! enable or disable dynamic loading mode
@@ -857,6 +860,7 @@ public function update($data) {
857860
public function enable_live_update($table, $url=false, $origin_table = false){
858861
$this->live_update = new $this->live_update_data_type($this->sql, $this->config, $this->request, $table,$url, array("connector" => $this, "table" => $origin_table));
859862
$this->live_update->set_event($this->event,$this->names["item_class"]);
863+
$this->live_update->set_encoding($this->encoding);
860864
$this->event->attach("beforeOutput", Array($this->live_update, "version_output"));
861865
$this->event->attach("beforeFiltering", Array($this->live_update, "get_updates"));
862866
$this->event->attach("beforeProcessing", Array($this->live_update, "check_collision"));

codebase/update.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,13 @@ class DataUpdate{
104104

105105
protected $table; //!< table , where actions are stored
106106
protected $url; //!< url for notification service, optional
107-
protected $sql; //!< DB wrapper object
108-
protected $config; //!< DBConfig object
109-
protected $request; //!< DBRequestConfig object
110-
protected $event;
111-
protected $item_class;
112-
protected $demu;
107+
protected $sql; //!< DB wrapper object
108+
protected $config; //!< DBConfig object
109+
protected $request; //!< DBRequestConfig object
110+
protected $encoding="utf-8";
111+
protected $event;
112+
protected $item_class;
113+
protected $demu;
113114

114115
//protected $config;//!< DataConfig instance
115116
//protected $request;//!< DataRequestConfig instance
@@ -141,6 +142,10 @@ public function set_event($master, $name){
141142
$this->event = $master;
142143
$this->item_class = $name;
143144
}
145+
146+
public function set_encoding($encoding){
147+
$this->encoding = $encoding;
148+
}
144149

145150
protected function select_update($actions_table, $join_table, $id_field_name, $version, $user) {
146151

@@ -222,8 +227,8 @@ public function get_updates() {
222227
$output = $this->render_set($this->sql->select($sub_request), $this->item_class);
223228

224229
ob_clean();
225-
header("Content-type:text/xml");
226-
230+
header("Content-type:text/xml; charset=".$this->encoding);
231+
227232
echo $this->updates_start();
228233
echo $this->get_version();
229234
echo $output;
@@ -346,4 +351,4 @@ protected function output($res){
346351

347352
}
348353

349-
?>
354+
?>

0 commit comments

Comments
 (0)