I'm querying the Facebook API in PHP to get a list of posts and display it on a website.
// $facebook is an instance of Facebook\Facebook
$response = $facebook->get('posts?fields=id,message,created_time,full_picture,permalink_url,status_type&limit=20');
$graphEdge = $response->getGraphEdge();
$posts = [];
foreach ($graphEdge as $post) {
$message = $post->getField('message');
}
The text returned by the call looks like the picture below:
My problem is that sometimes the formatting of the text seems to be embedded in the characters themselves. For eg., the text "Montélimar - aux Portes du Soleil" uses a different font than what's defined in CSS and I can't force it to use a different style. The HTML looks like this:
<p>
Profitez d’un cadre de vie idéal pour faire construire votre maison individuelle sur la commune de ́ - ☀️
Notre lotissement « ́ » ...
</p>
We even store the data in a JSON object and it looks like this (see the "description" field):
[
{
"pageName": "---",
"type": "---",
"date": "---",
"description": "Profitez d’un cadre de vie idéal pour faire construire votre maison individuelle sur la commune de ́ - ☀️ Notre lotissement « ́ » ...",
"time": 0000,
"thumbnail": "---",
"url": "---",
"img": "---"
}
]
As you can see, some text has a default styling that I can't figure how to get rid of. I've tried to re-encode the text to UTF-8 via PHP using mb_convert_encoding(); but this doesn't solve the problem because the string is already UTF-8.
How can I remove this formatting? Is this even formatting, or just special UTF-8 symbols?
