Sample javascript function that if parameter be farsi word returned true else returned false. Example : var input="بهنام رسولی"; if(farsi_checker(input)) alert('this word is farsi :)'); else alert('this word is Not farsi !');