I want to convert unicode to character.
For this I tried https://stackoverflow.com/a/7278961/4073217 post but it is not working for me.
For Example :
$string = '%u0391%u03b8%u03b1%u03bd%u03b1%u03c3%u03af%u03bf%u03c5';
$string = preg_replace('/%u([0-9A-F]+)/', '&#x$1;', $string);
echo html_entity_decode($string, ENT_COMPAT, 'UTF-8');
Output should be Αθανασίου
but above method returning Αb8b1bdb1c3afbfc5
.
Am I doing anything wrong? How do I get correct characters from Unicode in php?