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:::
Please, try to define the correct encoding type for your connector:
docs.dhtmlx.com/connector__php_ … etencoding
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.