Click here to Skip to main content
15,903,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using microsoft chart and it works great but i dont want show numbers in english mode,
I need to show numbers in 1256 char-set;

any help would be greatly appreciated.
Posted
Comments
Sergey Alexandrovich Kryukov 1-Jan-12 10:30am    
What exactly do you want to show? If you see my answer you can understand what do I mean.
Happy New Year!
--SA

1 solution

Where have you been? Even though 1256 charset would work in HTML page, it has been replaced with Unicode, which can be used to support nearly all languages in one text. ASP.NET supports Unicode; using anything else would be quite awkward; I don't even want to discuss it.

Now, do you mean Arabic digits? There are two different meanings in Arabic digits. Commonly used digits '0' to '9' are also called "Arabic" because they have been introduced in Europe by Arabs in X century. If you mean older form of Arabic numerals (٠‎ - ١‎ - ٢‎ - ٣‎ - ٤‎ - ٥‎ - ٦‎ - ٧‎ - ٨‎ - ٩), code points U+0660 to U+0669. This is a different system called "Eastern Arabic Numerals".

See:
http://en.wikipedia.org/wiki/Hindu%E2%80%93Arabic_numeral_system[^],
http://en.wikipedia.org/wiki/Eastern_Arabic_numerals[^].

[EDIT]
Please pay attention: you can also use Persian variant of Eastern Arabic numerals, with each digit using different Unicode code point, even for digit glyphs looking identical. Please see the second link above.
[END EDIT]

To find any code point, you can use the "Character Map" application bundled with all versions of Windows, charmap.exe.

Now, I'm afraid that if you want to use Eastern Arabic system, you will have to replace the digits by your own code. As far as I understand, in Arabic countries both systems are used, and the use of '0'-'9' is the default. As I learned from the other CodeProject questions, the methods of numeric types ToString(IFormatProvider) will return a string with '0'-'9' digits even if Arabic culture is used as the argument.

For thee usage of IFormatProvider, use the class System.Globalization.CultureInfo which implements this interface.

See http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx[^].

For example of the usage of ToString(IFormatProvider) (with culture) see, for example System.Int32.ToString with code sample:
http://msdn.microsoft.com/en-us/library/cht2hdff.aspx[^].

You certainly need to understand how Unicode works. See:

http://en.wikipedia.org/wiki/Unicode[^],
http://unicode.org/[^],
http://unicode.org/faq/utf_bom.html[^].

—SA
 
Share this answer
 
v2
Comments
Espen Harlinn 1-Jan-12 10:30am    
my 5
Sergey Alexandrovich Kryukov 1-Jan-12 10:34am    
Thank you, Espen.
--SA
Jamal Seyedi 2-Jan-12 5:28am    
thanks for answring me.
I've been reading and testing whatever you posted.
what i wanted was exactly what you said.
now I've got this :
CultureInfo faCulture = CultureInfo.CreateSpecificCulture("fa-Ir");
faCulture.NumberFormat.DigitSubstitution = DigitShapes.NativeNational
"21".ToString(faCalture) // the output : 21
what i expect is : ٢‎١‎
what should I have wrote.

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