Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Firefox
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 29-Jun-11 1:12am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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? Smile | :) )
 
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:
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:
 
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
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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..
 
-----------
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 325
1 DamithSL 300
2 Sergey Alexandrovich Kryukov 289
3 CPallini 235
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 30 Jun 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100