I'm writing a book in Persian. In its index there is a problem. Words are using Arabic order! So it causes a problem as in Arabic language they don't have four letters 'پ p (in pen)', 'چ ch (in cheese)', 'گ g (in gas)' and 'ژ zh or s (in usual)'. So these 4 letters are deleted from their main places and these are appeared after all letters but it's wrong, for example 'پ p' should be after 'ب b' and before 'ت t'. I would to see can I define order between letters of an alphabet myself. So I'm not only seeking a solution for the above problem and my question is the generalized form of it (the general case may be useful sometimes).
As some may need an example I wrote one (this is just an example).
\documentclass[12pt,a4paper]{article}
\usepackage[next]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=1.50cm]{geometry}
\usepackage{xepersian}
\settextfont{XB Niloofar}
\author{A.H. SadeghiManesh}
\makeindex
\begin{document}
نمونه
\index{بالارونده}
\index{پائینرونده}
\index{تعمیم قضیه}
\printindex
\end{document}
The result is as the image. but the third word should be between two others and not the last one!


xindy? An MWE would really help here. Please give three example index entries and mark the one, which is set to the wrong place. I do not speak Persian and do not want to set up this problem for you. Information about your index packages and the language packages as well as the documentclass are mandatory here. Thanks. – LaRiFaRi Nov 14 '14 at 16:15