PDA

View Full Version : Grid Panel MySQL-Encoding Problem



flashg0101
17 Sep 2009, 11:27 PM
Hi,
I got a charset problem in my grid-Panel. I use a mysql-db with latin1 encoding.
In my grid-panel all datasets with ..etc. will be cutted off before that character..


$rs_count = mysql_query($sql_count);
$rows = mysql_num_rows($rs_count);
$rs = mysql_query($sql);

while($obj = mysql_fetch_object($rs))
{
$arr[] = $obj;
}



echo $_GET['callback'].'({"total":"'.$rows.'","results":'.json_encode($arr).'})';



I tried a utf8_encode, but it doesn't work (arr[]=utf8_encode($obj);) ....

What else can I do?

Thanks and regards

Gordon

flashg0101
17 Sep 2009, 11:54 PM
I found out that the "json_encode"-function destroys the chars...
How can I convert the chars?