asp.net中的阿拉伯数字问题 [英] Arabic number problem in asp.net

查看:115
本文介绍了asp.net中的阿拉伯数字问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web应用程序及其阿拉伯语版本.我通过区域设置"将语言更改为阿拉伯语.现在,FireFOx显示阿拉伯语文本,但显示英文数字stil.我希望所有数字都自动编码为阿拉伯语.请有人帮我吗?????

在IE中,它可以正常工作...
请帮助我

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

推荐答案

好吧,我并没有针对具体的阿拉伯文化进行检查,因为阿拉伯数字的种类有所不同.从小学生起,请记住我们经常使用的我们的西方数字-0123456789-被称为阿拉伯数字. (对您来说是个惊喜吗?:-))

还有更多阿拉伯语"的东西吗?当然,后来我碰到了数字:
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: ''٬''.



(我不得不将它们括在PRE块中,因为要编辑从左到右和从右到左的Unicode字符非常困难.)

印度-阿拉伯数字系统有不同的变体.

根据 http://en.wikipedia.org的说法,第一个变体称为西方阿拉伯语",第二个变体称为东方阿拉伯语". /wiki/Glyphs_used_with_the_Hindu-Arabic_numeral_system [ ^ ] .关于东部阿拉伯语,请参见 http://en.wikipedia.org/wiki/Eastern_Arabic_numerals [



(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);
//...



但是,应该使用哪种文化来获取东部阿拉伯语?我不知道;而且我不知道.NET是否存在这种支持.

如果没有,这很容易解决.这些数字由Unicode代码点范围0x0660到0x0669(代表0到9)表示,后跟阿拉伯数字百分号,十进制分隔符和千位分隔符.因此,可以使用简单的转换:



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();
}



参见
http://unicode.org/ [ ^ ].

—SA



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

—SA


感谢...
我找到了解决办法.

我这样更改了Firefox配置

在Firefox的地址栏中输入"about:config".
然后采用bidi-numeral并将其值更改为3或4.它将自动将所有数字更改为阿拉伯数字.
无需在程序中执行任何操作..

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

-----------


这篇关于asp.net中的阿拉伯数字问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆