Some time ago I developed this solution for my PHP environment,
function changeLetters($string, $down = true){
$letters = array(
'A'=>array('@','â','ä','à','å','Ä','Å','á','ª','Á','Â','À','ã','Ã'),
'E'=>array('&','é','ê','ë','è','É','£','Ê','Ë','È'),
'I'=>array('!','ï','î','ì','¡','Í','Î','Ï','Ì','í'),
'O'=>array('ô','ö','ò','Ö','ø','Ø','ó','º','¤','ð','Ó','Ô','Ò','õ','Õ'),
'U'=>array('ü','û','ù','Ü','ú','µ','Ú','Û','Ù'),
'B'=>array('ß'),
'C'=>array('Ç','ç','©','¢'),
'D'=>array('Ð'),
'F'=>array('ƒ'),
'L'=>array('¦'),
'N'=>array('ñ','Ñ'),
'S'=>array('$','§'),
'X'=>array('×'),
'Y'=>array('ÿ','¥','ý','Ý'),
'AE'=>array('æ','Æ'),
'P'=>array('þ','Þ'),
'R'=>array('®'),
'0'=>array('°'),
'1'=>array('¹','ı'),
'2'=>array('²'),
'3'=>array('³'),
);
foreach ($letters as $letter => $change){
if($down){ $letter = down($letter); }
$string = str_replace($change, $letter, $string);
}
return $string;
}
I know your question is based on r
language, but I posted more as a help for the possible variant of letters.