I am making an api in which i fetch data which contains column some special character value when i convert them in json format it's value is change from 100⬠to 100âÂ\u0082¬ . I don't want this \u0082 extra characters .
Here is my code
$UserDetailSql = "SELECT * FROM `characteristic` WHERE event_id='" . $events->id . "'";
//$this->_db->my_query("SET NAMES 'UTF8'");
$UserDetailSqlVal = $this->_db->my_query($UserDetailSql);
$temp_char = array();
while($characteristic = $this->_db->my_fetch_object($UserDetailSqlVal)){
$char_temp['characteristic_id'] = $characteristic->characteristic_id;
$char_temp['title_description'] = $characteristic->title;
$char = $this->_common->getEventCharacterstics($characteristic->characteristic_id);
$char_temp['title'] = $char->title;
$char_temp['image'] = IMG_PATH.'characterstics/'.$char->image;
$temp_char[] = $char_temp;
}
$temp['characteristic'] = $temp_char;
echo json_encode($temp);`
Here $characteristic->title
can have catalan or spanish or english data.The value i give in heading is this column.
I tried utf8_encode()
,htmlentities()
,htmlspecialcharacters()
but no luck please help i am fed up now.Thanks in advance.