Malayalam Unicode issues while displaying some characters (code in php)

When we use malayalam unicode in social share titles or description or any where, some of the characters like ‘Chillu’ look like wrong. Usually malayalam “chillaksharam” causes problems.
To correct this, use the below code in php.
Here we replacing split characters with single character.
You can see the difference once you copied this code into notepad, and try to delete both characters  “ണ്‍”, “ൺ” .
Call function : chill_correcting($in);
Definition:
function chill_correcting($in) {
$in=str_replace (“ണ്‍”, “ൺ”, $in);
$in=str_replace (“ന്‍”, “ൻ”, $in);
$in=str_replace (“ര്‍”, “ർ”, $in);
$in=str_replace (“ല്‍”, “ൽ”, $in);
$in=str_replace (“ള്‍”, “ൾ”, $in);
return $in;
}