here is how i do it in javascript
qwerty_mapping = {
"ת":"," ,",":"ת"
,"ף":";" ,";":"ף"
,"ץ":"." ,".":"ץ"
,"ש":"a" ,"a":"ש"
,"נ":"b" ,"b":"נ"
,"ב":"c" ,"c":"ב"
,"ג":"d" ,"d":"ג"
,"ק":"e" ,"e":"ק"
,"כ":"f" ,"f":"כ"
,"ע":"g" ,"g":"ע"
,"י":"h" ,"h":"י"
,"ן":"i" ,"i":"ן"
,"ח":"j" ,"j":"ח"
,"ל":"k" ,"k":"ל"
,"ך":"l" ,"l":"ך"
,"צ":"m" ,"m":"צ"
,"מ":"n" ,"n":"מ"
,"ם":"o" ,"o":"ם"
,"פ":"p" ,"p":"פ"
,"/":"q" ,"q":"/"
,"ר":"r" ,"r":"ר"
,"ד":"s" ,"s":"ד"
,"א":"t" ,"t":"א"
,"ו":"u" ,"u":"ו"
,"ה":"v" ,"v":"ה"
,"'":"w" ,"w":"'"
,"ס":"x" ,"x":"ס"
,"ט":"y" ,"y":"ט"
}
function correctChar(old_char){
if(qwerty_mapping[old_char] == undefined)
{
return(old_char)
}
else
{
return(qwerty_mapping[old_char])
}
}
function correctString(old_string){
new_string = ""
for(i=0;i<old_string.length;i++){
new_string = new_string+correctChar(old_string[i])
}
return new_string;
}