Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - ahmedmii
1
Off-topic / etting error on UTF-8 characters
« on November 20th, 2015, 08:10 AM »
Hello,

I'm using php to read from INSTAGRAM API, get comment on its media

Eg.

sending $url = 'https://api.instagram.com/v1/media/'.$mediaID.'/comments?client_id='. clientID;

I read the results like this:

$test=html_entity_decode($url,null,'UTF-8');


$instagramInfo = connectToInstagram($test);
$results = json_decode($instagramInfo, true);
foreach($results['data'] as $item){
$commentText = $item['text'];
echo $commentText.'<br/>';
}


Here's an example of the output:

™آƒأ™آٹأ™آ„ أ™آپأ™آٹأ™آƒ أکآ§أکآ° أ™آ†أ™آٹأکآھأ™آƒ أ™آˆأکآµأکآ®أ™آ‡ أکآ§أ™آ„أ™آ„أ™آ‡ أ™آ„أکآ§ أ™آٹأ™آˆأ™آپأ™آ‚أ™آƒ أ™آˆأ™آ„أکآ§ أ™آٹأکآ³أکآ¹أکآ¯أ™آƒ أکآ­أکآ³أکآ¨أ™آٹ أکآ§أ™آ„أ™آ„أ™آ‡ أ™آˆأ™آ†أکآ¹أ™آ… أکآ§أ™آ„أ™آˆأ™آƒأ™آٹأ™آ„ أکآ§أکآ° أکآ£أ™آ†أکآھ أکآھأ™آپأ™آƒأکآ± أ™آپأ™آٹأ™آ†أ™آٹ أکآ¨أکآ°أکآ§ أکآ§أ™آ„أکآ·أکآ±أ™آٹأ™آ‚أ™آ‡ أکآ±أ™آˆأکآ­ أکآ§أ™آ„أ™آ„أ™آ‡ أ™آ„أکآ§ أ™آٹأکآ³أکآ¹أکآ¯أ™آƒ أ™آ„أکآ§ أکآ¯أ™آ†أ™آٹأکآ§ أ™آˆأ™آ„أکآ§ أکآ¢أکآ®أکآ±

The issue I'm having is I can't read the comment it's unknown chars. I tried to change the encode to UTF-8 it didn't work

anyone else having the same issue?