:100644 100644 8c1f64c... 0000000... M	src/arabic.c
:100644 100644 3a948d0... 0000000... M	src/arabic.h

diff --git a/src/arabic.c b/src/arabic.c
--- a/src/arabic.c
+++ b/src/arabic.c
@@ -33,6 +33,7 @@ static int  half_shape __ARGS((int c));
 static int  A_firstc_laa __ARGS((int c1, int c));
 static int  A_is_harakat __ARGS((int c));
 static int  A_is_iso __ARGS((int c));
+static int  A_is_iso_or_farsi __ARGS((int c));
 static int  A_is_formb __ARGS((int c));
 static int  A_is_ok __ARGS((int c));
 static int  A_is_valid __ARGS((int c));
@@ -85,6 +86,12 @@ A_is_a(cur_c)
 	case a_WAW:
 	case a_ALEF_MAKSURA:
 	case a_YEH:
+	case a_PEH:
+	case a_TCHEH:
+	case a_JEH:
+	case a_KEHEH:
+	case a_GAF:
+	case f_YEH:
 	    return TRUE;
     }
 
@@ -137,6 +144,12 @@ A_is_s(cur_c)
 	case a_s_WAW:
 	case a_s_ALEF_MAKSURA:
 	case a_s_YEH:
+	case a_s_PEH:
+	case a_s_TCHEH:
+	case a_s_JEH:
+	case a_s_KEHEH:
+	case a_s_GAF:
+	case f_s_YEH:
 	    return TRUE;
     }
 
@@ -192,6 +205,12 @@ A_is_f(cur_c)
 	case a_f_LAM_ALEF_HAMZA_ABOVE:
 	case a_f_LAM_ALEF_HAMZA_BELOW:
 	case a_f_LAM_ALEF:
+	case a_f_PEH:
+	case a_f_TCHEH:
+	case a_f_JEH:
+	case a_f_KEHEH:
+	case a_f_GAF:
+	case f_f_YEH:
 	    return TRUE;
     }
     return FALSE;
@@ -320,10 +339,27 @@ chg_c_a2s(cur_c)
 	case a_YEH:
 	    tempc = a_s_YEH;
 	    break;
+	case a_PEH:
+	    tempc = a_s_PEH;
+	    break;
+	case a_TCHEH:
+	    tempc = a_s_TCHEH;
+	    break;
+	case a_JEH:
+	    tempc = a_s_JEH;
+	    break;
+	case a_KEHEH:
+	    tempc = a_s_KEHEH;
+	    break;
+	case a_GAF:
+	    tempc = a_s_GAF;
+	    break;
+	case f_YEH:
+	    tempc = f_s_YEH;
+	    break;
 	default:
 	    tempc = 0;
     }
-
     return tempc;
 }
 
@@ -450,6 +486,24 @@ chg_c_a2i(cur_c)
 	case a_YEH:
 	    tempc = a_i_YEH;
 	    break;
+	case a_PEH:
+	    tempc = a_i_PEH;
+	    break;
+	case a_TCHEH:
+	    tempc = a_i_TCHEH;
+	    break;
+	case a_JEH:     /* exception */
+	    tempc = a_s_JEH;
+	    break;
+	case a_KEHEH:
+	    tempc = a_i_KEHEH;
+	    break;
+	case a_GAF:
+	    tempc = a_i_GAF;
+	    break;
+	case f_YEH:
+	    tempc = f_i_YEH;
+	    break;
 	default:
 	    tempc = 0;
     }
@@ -580,6 +634,24 @@ chg_c_a2m(cur_c)
 	case a_YEH:
 	    tempc = a_m_YEH;
 	    break;
+	case a_PEH:
+	    tempc = a_m_PEH;
+	    break;
+	case a_TCHEH:
+	    tempc = a_m_TCHEH;
+	    break;
+	case a_JEH:			/* exception */
+	    tempc = a_f_JEH;
+	    break;
+	case a_KEHEH:
+	    tempc = a_m_KEHEH;
+	    break;
+	case a_GAF:
+	    tempc = a_m_GAF;
+	    break;
+	case f_YEH:
+      tempc = a_m_YEH;
+	    break;
 	default:
 	    tempc = 0;
     }
@@ -720,6 +792,24 @@ chg_c_a2f(cur_c)
 	case a_YEH:
 	    tempc = a_f_YEH;
 	    break;
+	case a_PEH:
+	    tempc = a_f_PEH;
+	    break;
+	case a_TCHEH:
+	    tempc = a_f_TCHEH;
+	    break;
+	case a_JEH:
+	    tempc = a_f_JEH;
+	    break;
+	case a_KEHEH:
+	    tempc = a_f_KEHEH;
+	    break;
+	case a_GAF:
+	    tempc = a_f_GAF;
+	    break;
+	case f_YEH:
+	    tempc = f_f_YEH;
+	    break;
 	default:
 	    tempc = 0;
     }
@@ -808,6 +898,21 @@ chg_c_i2m(cur_c)
 	case a_i_YEH:
 	    tempc = a_m_YEH;
 	    break;
+	case a_i_PEH:
+	    tempc = a_m_PEH;
+	    break;
+	case a_i_TCHEH:
+	    tempc = a_m_TCHEH;
+	    break;
+	case a_i_KEHEH:
+	    tempc = a_m_KEHEH;
+	    break;
+	case a_i_GAF:
+	    tempc = a_m_GAF;
+	    break;
+	case f_i_YEH:
+	    tempc = a_m_YEH;
+	    break;
 	default:
 	    tempc = 0;
     }
@@ -842,6 +947,7 @@ chg_c_f2m(cur_c)
 	case a_f_THAL:
 	case a_f_REH:
 	case a_f_ZAIN:
+	case a_f_JEH:
 	case a_f_WAW:
 	case a_f_ALEF_MAKSURA:
 	    tempc = cur_c;
@@ -912,6 +1018,22 @@ chg_c_f2m(cur_c)
 	case a_f_YEH:
 	    tempc = a_m_YEH;
 	    break;
+	case a_f_PEH:
+	    tempc = a_m_PEH;
+	    break;
+	case a_f_TCHEH:
+	    tempc = a_m_TCHEH;
+	    break;
+	case a_f_KEHEH:
+	    tempc = a_m_KEHEH;
+	    break;
+	case a_f_GAF:
+	    tempc = a_m_GAF;
+	    break;
+	case f_f_YEH:
+	    tempc = f_m_YEH;
+	    break;
+
 	    /* NOTE: these encodings are multi-positional, no ?
 		case a_f_LAM_ALEF_MADDA_ABOVE:
 		case a_f_LAM_ALEF_HAMZA_ABOVE:
@@ -1053,7 +1175,7 @@ arabic_shape(c, ccp, c1p, prev_c, prev_c1, next_c)
     else if (!shape_c || A_is_f(shape_c) || A_is_s(shape_c) || prev_laa)
 	curr_c = A_is_valid(next_c) ? chg_c_a2i(c) : chg_c_a2s(c);
     else if (A_is_valid(next_c))
-	curr_c = A_is_iso(c) ? chg_c_a2m(c) : chg_c_i2m(c);
+	curr_c = A_is_iso_or_farsi(c) ? chg_c_a2m(c) : chg_c_i2m(c);
     else if (A_is_valid(prev_c))
 	curr_c = chg_c_a2f(c);
     else
@@ -1117,6 +1239,14 @@ A_is_iso(c)
 	    || c == a_MINI_ALEF);
 }
 
+    static int
+A_is_iso_or_farsi(c)
+    int c;
+{
+    return (A_is_iso(c)
+	    || (c == a_PEH || c == a_TCHEH || c == a_JEH || c == a_KEHEH || c == a_GAF || c == f_YEH)
+	    || (c >= f_ZERO && c <= f_NINE));
+}
 
 /*
  * A_is_formb returns TRUE if 'c' is an Arabic 10646-1 FormB character
@@ -1129,6 +1259,7 @@ A_is_formb(c)
     return ((c >= a_s_FATHATAN && c <= a_s_DAMMATAN)
 	    || c == a_s_KASRATAN
 	    || (c >= a_s_FATHA && c <= a_f_LAM_ALEF)
+	    || (c >= a_s_PEH && c <= f_f_YEH)
 	    || c == a_BYTE_ORDER_MARK);
 }
 
@@ -1140,7 +1271,7 @@ A_is_formb(c)
 A_is_ok(c)
     int c;
 {
-    return (A_is_iso(c) || A_is_formb(c));
+    return (A_is_iso_or_farsi(c) || A_is_formb(c));
 }
 
 
diff --git a/src/arabic.h b/src/arabic.h
--- a/src/arabic.h
+++ b/src/arabic.h
@@ -100,6 +100,26 @@
 #define a_MINI_ALEF			0x0670
 /* Rest of 8859-6 does not relate to Arabic */
 
+/* These used in Farsi numbers */
+#define a_PEH				0x067e
+#define a_TCHEH			0x0686
+#define a_JEH				0x0698
+#define a_KEHEH			0x06a9
+#define a_GAF				0x06af
+#define f_YEH				0x06cc
+
+#define f_ZERO			0x06f0
+#define f_ONE				0x06f1
+#define f_TWO				0x06f2
+#define f_THREE			0x06f3
+#define f_FOUR			0x06f4
+#define f_FIVE			0x06f5
+#define f_SIX				0x06f6
+#define f_SEVEN			0x06f7
+#define f_EIGHT			0x06f8
+#define f_NINE			0x06f9
+
+
 /*
  * Arabic Presentation Form-B (subset of 10646; FE70 - FEFF)
  *
@@ -252,7 +272,32 @@
 #define a_s_LAM_ALEF			0xfefb
 #define a_f_LAM_ALEF			0xfefc
 
+/* Farsi */
+#define a_s_PEH				0xfb56
+#define a_f_PEH				0xfb57
+#define a_i_PEH				0xfb58
+#define a_m_PEH				0xfb59
+#define a_s_TCHEH			0xfb7a
+#define a_f_TCHEH			0xfb7b
+#define a_i_TCHEH			0xfb7c
+#define a_m_TCHEH			0xfb7d
+#define a_s_JEH				0xfb8a
+#define a_f_JEH				0xfb8b
+#define a_s_KEHEH			0xfb8e
+#define a_f_KEHEH			0xfb8f
+#define a_i_KEHEH			0xfb90
+#define a_m_KEHEH			0xfb91
+#define a_s_GAF				0xfb92
+#define a_f_GAF				0xfb93
+#define a_i_GAF				0xfb94
+#define a_m_GAF				0xfb95
+#define f_s_YEH				0xfbfc
+#define f_f_YEH				0xfbfd
+#define f_i_YEH				0xfbfe
+#define f_m_YEH				0xfbff
+
 #define a_BYTE_ORDER_MARK		0xfeff
 
-/* Range of Arabic characters that might be shaped. */
-#define ARABIC_CHAR(c)		((c) >= a_HAMZA && (c) <= a_MINI_ALEF)
+/* Range of Arabic and Farsi characters that might be shaped. */
+#define ARABIC_CHAR(c)		( ((c) >= a_HAMZA && (c) <= a_MINI_ALEF) \
+                             || ((c) >= a_PEH && (c) <= f_NINE) )
