11

How can I disable the digit substitution (for example for Hindi numerals instead of Arabic ones) for my application (native c++) completely?

I want all the numbers displayed with 0123 instead of ٠١٢٣

There is an option in localization options in windows, but I don't want to change that for the user. Only for my app.

Thank you!

j0k
  • 22,600
  • 28
  • 79
  • 90
kcode
  • 1,220
  • 1
  • 18
  • 34

3 Answers3

1

With minor typographical consequences, you can use the U+FF1x characters instead of U+003x.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
1

Slightly confused by you saying native C++ and still having a WinForms tag...

Assuming that it's a native C++ app without any .Net, I'd look at the SetThreadLocale function as described here.

Hans Olsson
  • 54,199
  • 15
  • 94
  • 116
  • thank you for the answer, but this does not work in any case. see this posting the gdi functions do not honor the settings. http://blogs.msdn.com/b/michkap/archive/2008/06/16/8603298.aspx – kcode Jun 11 '10 at 11:01
1

Not sure if it'll work, but try to call SetLocalInfo with the LCType parameter set to LOCALE_IDIGITSUBSTITUTION. Take a look at the MSDN documentation for GetLocalInfo and SetLocalInfo. It does not seem to be possible to change all values programmatically, also I'm not sure if this will only affect the active process. Hope this helps!

humbagumba
  • 2,054
  • 15
  • 16