Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a web application and its in Arabic. I changed my language to Arabic through Regional Settings. Now, FireFOx shows arabic text but number stil in english. I want all the numbers to encode to arabic by automatically. please anybody help me?????

in IE,its working fine...
please help me
Posted

Well, I did not check it up with concrete Arabic cultures because there are different kind of Arabic numerals. From elementary school children remember that our Western numerals we always used — 0123456789 — are called Arabic Numerals. (Is it a surprise for you? :-))

Is there something "more Arabic"? Of course, later on I came across the numerals:
٠ 	١ 	٢ 	٣ 	٤ 	٥ 	٦ 	٧ 	٨ 	٩
Decimal separator: '٫', thousand separator: '٬'.


(I had to enclose them in PRE block because it's pretty hard to edit a mix of left-to-right and right-to-left Unicode characters.)

There are different variants of the Hindu-Arabic numeral system.

First variant is called "Western Arabic", second one — "Eastern Arabic", according to http://en.wikipedia.org/wiki/Glyphs_used_with_the_Hindu-Arabic_numeral_system[^]. About Eastern Arabic, see http://en.wikipedia.org/wiki/Eastern_Arabic_numerals[^].

So, do you need Eastern Arabic?

One could expect that right representation could be obtained using correct culture for string numeric format:
C#
int myInteger = //
string cultireId = //?
string num = myInteger.ToString(new System.CultureInfo(cultureId));

//using a different constructor:
int cultireId = //?
CultureInfo culture = new CultureInfo(cultureId);
//...


But what culture should be used to obtain Eastern Arabic? I don't know; and I don't know if such support exist in .NET.

If not, this is easy to work around. These digits are represented by the Unicode code point range 0x0660 to 0x0669 (representing 0 to 9), followed by Arabic percent sign, decimal separator and thousand separator. So, a simple conversion could be used:

C#
const UInt16 shift = 0x0660 - 0x0030;

//...

string EasternArabic(int value) {
    System.Text.StringBuilder sb = new System.Text.StringBuilder();
    foreach(char input in neutral) {
        UInt16 codePoint = Convert.ToUInt16(input);
        codePoint += shift;
        sb.Append(Convert.ToChar(codePoint));
    }
    return sb.ToString();
}


See http://unicode.org/[^].

—SA
 
Share this answer
 
v3
Thanks...
I got the solution.

i changed the Firefox configuration like this

Type " about:config " in the address bar of Firefox.
then take bidi-numeral and change its value to 3 or 4. it wil automatically change all numbers to arabic number.
No need to do anything in the program..

-----------
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900