I created account in hostinger.in and created a php that will fetch contents from database table. People saying my question is duplicate of this question.
Things i tried from this question which you are saying as duplicate
What they provided there is to Specify the utf8mb4 character set on all tables and text columns in your database . But my problem is different here. I already specified my encoding in TABLE. But then also while printing in php, it is not showing the result properly.
Another thing what they provided is to use below code
$mysqli->set_charset('utf8mb4'); // object oriented style
mysqli_set_charset($link, 'utf8mb4');
I used that too, but i didn't got output.
This is my db.php
<?php
$con=mysqli_connect("HOST","mysql","mypass","u558167714_mydb");
if(!$con)
{
echo "Connection error... ".mysqli_connect_error();
}
else
{
echo "Connection Successful..."
}
?>
And my index.php
<?php
require_once 'db.php';
$query = "SELECT * FROM quotes LIMIT 1";
$result = mysqli_query($con, $query);
while($row = mysqli_fetch_array($result)){
print(json_encode($row['quote']));
}
?>
The actual content in my database is This is தமிழ்
But what i am receiving when i am getting is "This is \u0ba4\u0bae\u0bbf\u0bb4\u0bcd " .
This is my url.
I saw lots of questions similar to mine and tried following commands,
mysqli_set_charset($this->mysqli,"utf8"); or
mysqli_set_charset($conn,"utf8");
but i am not getting the correct output.
How can i actually set my character set to get my output.