How to prevent showing the diamond question mark symbol, even using mb_substr and utf-8

EnexoOnoma picture EnexoOnoma · Jul 10, 2011 · Viewed 16.3k times · Source

I have read some other questions, tried the answers but got no result at the end. What I get is for example this

Μήπως θα έπρεπε να � ...

and I can't remove that weird question mark. What I do is to get the content of an RSS feed that is encoded also to <?xml version="1.0" encoding="UTF-8"?> using Greek language for the content.

Is there any way to fix this?

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<div><?php
    $entry->description = strip_tags($entry->description);
    echo mb_substr($entry->description, 0, 490);
?> ...</div>

Answer

EnexoOnoma picture EnexoOnoma · Jul 11, 2011

This is the answer

mb_substr($entry->description, 0, 490, "UTF-8");