this is because of the difference,between the keyboard layouts,in some cases the location of Persian "پ" is not the desired,or expected location that,Iranian always using,you can fix it using this DLL file
KBDFA.DLL
here is the website that created this DLL.
if you want use a software that is not support the Persian keyboard,there are some solutions for this,you can use the free Lemoon software,Here is the link to that software
there is another solution for fixing the keyboard layout:you can use the Keyboard Layout Manager software and change your keyboard layout.