UTF-8 encoding and upper case letters of ÆØÅ

Hi

I have loading data from a MySQL database. I works :slight_smile: . But every time the “text” string contains a upper case Æ,Ø or Å nothing is returned. Changing it to lower case let the data go to the client for rendering. What I am doing now :

My data.php :

	require_once($this->f3->get('ROOT').'/ui/dhtmlx/connector/db_pdo.php');
	include ($this->f3->get('ROOT').'/ui/dhtmlx/connector/gantt_connector.php');
	$res= new PDO($this->f3->get('db_dns').$this->f3->get('SESSION.db_name'),$this->f3->get('db_user'),$this->f3->get('db_pass'));
	$gantt = new JSONGanttConnector($res, "PDO");
//	$gantt->set_encoding("iso-8859-1");
	$gantt->mix("open", 1);
	$gantt->render_links("Gantt_links", "id", "source,target,type");
	$gantt->render_table("Gantt_tasks", "id", "start_date,duration,text,progress,sortorder,parent","");

Saving to the “text” field in Gantt_tasks I use utf8_encode. Headers is set to utf-8 and the db set to utf-8. Anything I missed here.

br

larsbrandi

Please try to enable log and check its content.
Log file will contain a detailed error message and SQL code of all queries. You can try to run the queries from the log, that doesn’t work correctly, directly against the DB

$gantt->enable_log("some.txt"); $gantt->render_table("Gantt_tasks", "id",

When running the query with “Ø”, nothing is returned and the log contains the following :

====================================
Log started, 26/01/2015 11:26:42

SELECT id,start_date,duration,text,progress,sortorder,parent FROM Gantt_tasks

SELECT id,source,target,type FROM Gantt_links

Done in 0.011361837387085s
No errors is returned.

Narrowing it down now. Edit the text on client side, and returning it to the DB is going OK. The log returnes a UPDATE. And the Ø is inserted as “Ø” . When I am inserting Ø into Gantt_tasks from my application it is inserted as “Ø”. Wierd. Can’t get my head around this one.

Which encoding you are using for the client side app and for the database ?

By default code expects that both parts are using UTF.
If you are using non-utf encoding, you need to try to switch server side code to GanttConnector ( xml based version ) and use $gannt->set_encoding(“encoding name”);

docs.dhtmlx.com/connector__php__ … etencoding