Some of the letters of the Arabic script do not represent any native Persian sounds and thus are used only for Arabic loans. Therefore, e.g., there are four "z"-sounds in the Farsi script, ز ض ظ ذ. Now some of these letters are used in native words, for example ذ in گذشتن. Is there any phonetic logic behind that? Are there other examples for this?
What about غ and ق? Is there a hard and fast rule, like (that's what I heard) only geyn being used for native Persian words? (If that be so, in connection with the following question, what about the city قم?)
A related question concerns the names of places in Iran, for example Teheran (now written تهران, earlier طهران) and Esfahan (earlier, as far as I know, اصپهان). Are these place names of Arabic origin and therefore written with the "special characters" or is there some other reason behind that?