How can i convert English digits to Arabic digits?

前端 未结 7 803
有刺的猬
有刺的猬 2020-11-27 20:59

I have this C# code for example

DateTime.Now.ToString(\"MMMM dd, yyyy\");

Now the current thread is loading the Arabic culture. So the resu

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 21:51

    The only solution is to manually convert the digits.

    You could use the CurrentCulture.NumberFormat.NativeDigits array instead of explicitly providing the Unicode characters to support any other languages in addition to the Arabic-Indic digits, but as far as builtin support by culture-aware classes such as DateTime it seems unimplemented or something.

提交回复
热议问题