Dhtmlx grid xml shows ? for unicode

My XML file show output as:


vbhusal
vivek_bhusal@hotmail.com
???
Bhusal
9857033302

Here 3rd cell contain ‘???’ which is actuall nepali unicode text ‘विवेक’.
I am using mysqli; similar code work fine on mysql… the problem is when I change database to mysqli

Please, try to define correctly the encoding type on your server-side, also your generated xml file should have the same encoding type. Also please, check the using encoding type on your html-page.

Hello !
I am using codeigniter…
Code work fine when I fetch data from table and display it directly…
but the issue is only with DHTMLX.

What I have done till now is:

  • In the head
  • In config/config.php
    $config[‘charset’] = ‘UTF-8’;

  • In config/database.php
    $db[‘default’][‘char_set’] = ‘utf8’;
    $db[‘default’][‘dbcollat’] = ‘utf8_general_ci’;

Unfortunately the problem cannot be reconstructed locally.
dhtmlxGrid itself displays your provided text correctly.
Please, refer to the following snippet:
snippet.dhtmlx.com/1ffa21d16
If the problem still occurs for you please, provide a complete demo or share a demo link, where the problem can be reconstructed.

Yes locally it work fine in my case to… but issue arise while rendering data from database…
In my case I am using Mysqli with codeigniter… (MVC: Model, View, Control). I have attached complete code here…
connector:::
function grid_listuser(){
$this->load->model(‘dhtmlx_model’);
$mysqli = $this->dhtmlx_model->connection();
$grid = new GridConnector($mysqli,“MySQLi”);
$grid->dynamic_loading(20);
$sql = “SELECT * FROM users WHERE id !=1”;
$grid->render_sql($sql,“id”,“username,email,first_name,last_name,phone,action”);

}
model:::
public function connection(){

include_once (“dhtmlx/connector/codebase/grid_connector.php”);
include_once (“dhtmlx/connector/codebase/db_mysqli.php”);
$database = $this->load->database(‘default’,TRUE);
$mysqli = new mysqli($database->hostname, $database->username, $database->password, $database->database);

return $mysqli;
}
view:::

<?php echo link_tag('dhtmlx/dhtmlx.css'); echo link_tag('dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid.css'); echo link_tag('dhtmlx/dhtmlxGrid/codebase/skins/dhtmlxgrid_dhx_web.css'); echo link_tag('dhtmlx/dhtmlxMessage/codebase/themes/message_default.css'); echo script_tag('dhtmlx/dhtmlxcommon.js'); echo script_tag('dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid.js'); echo script_tag('dhtmlx/dhtmlxGrid/codebase/dhtmlxgridcell.js'); echo script_tag('dhtmlx/dhtmlxGrid/codebase/ext/dhtmlxgrid_filter.js'); echo script_tag('dhtmlx/dhtmlxDataProcessor/codebase/dhtmlxdataprocessor.js'); echo script_tag('dhtmlx/connector/codebase/connector.js'); echo script_tag('dhtmlx/dhtmlxGrid/codebase/ext/dhtmlxgrid_pgn.js'); echo link_tag('dhtmlx/dhtmlxGrid/codebase/ext/dhtmlxgrid_pgn_bricks.css'); echo link_tag('dhtmlx/dhtmlxWindows/codebase/dhtmlxwindows.css'); echo link_tag('dhtmlx/dhtmlxWindows/codebase/skins/dhtmlxwindows_dhx_web.css'); echo script_tag('dhtmlx/dhtmlxWindows/codebase/dhtmlxcontainer.js'); ?>
List Users
 

Please, try to define the correct encoding type for your connector:
docs.dhtmlx.com/connector__php_ … etencoding

I have tried that too…
didn’t work


Most probably your chars in the database or the html page/browser doesn’t use the UTF-8 encoding.
If the problem still occurs for you please, provide a complete demo or share a demo link, where the problem can be reproduced.