The unused case case (i.e. the case of the unused case), part 2

by Michael S. Kaplan, published on 2011/10/06 07:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2011/10/06/10221131.aspx


Part 1 of this two part series can be found at The unused case case (i.e. the case of the unused case).

Now in that part I pointed out three general scenarios covered by Digit Substitution across various versions of Windows:

  1. LOCALE_SNATIVEDIGITS are there, and LOCALE_IDIGITSUBSTITUTION has them turned on!
  2. LOCALE_SNATIVEDIGITS are not there, but LOCALE_IDIGITSUBSTITUTION has them turned off anyway, so who cares?
  3. LOCALE_SNATIVEDIGITS are not there, but LOCALE_IDIGITSUBSTITUTION has them turned on -- a classic no-op bug (described previously in A difference that makes no difference makes a blog)

I then pointed out that there was an obvious missing scenario.

In plain terms:

LOCALE_SNATIVEDIGITS are there, but LOCALE_IDIGITSUBSTITUTION has them turned off.

This is unlike scenario #3, which is basically a bug.

And although this didn't tend to generally occur to me before, this additional case is actually used at times - has a lot of appeal for some scenarios.

The ones where we determine the native digits are not most commonly used but are not enirely unheard of.

Like in Tamil and Bengali, which have LOCALE_SNATIVEDIGITS values of ০১২৩৪৫৬৭৮৯ and ௦௧௨௩௪௫௬௭௮௯, respectively -- despite the fact that they both set LOCALE_IDIGITSUBSTITUTION to "Never" substitute.

You can contrast this with Hindi, which use #2 above, and thus 0123456789 in LOCALE_SNATIVEDIGITS, rather than ०१२३४५६७८९.

The net effect? There is no programmatic way to query the "alternate preferred digits" in the Hindi case. Like you can with Bangla and Tamil.

Part of me feels that this may seem a little unnatural -- like an airplane intentionally making a bad landing.

But this scheme gives a flexibility of potential usage that none of the others can....which ultmimately makes ot more useful in such cases!


John Cowan on 6 Oct 2011 10:57 AM:

In Tamil, at least, the native digits are mostly obsolete: they are not used to represent numbers in ordinary circumstances.  In fact, they are used Chinese-style without a zero:  1066 is "1 thousand 6 ten 6".

Michael S. Kaplan on 6 Oct 2011 9:18 PM:

See blogs.msdn.com/.../359347.aspx -- modern use (when it happens) often treats then as digits....


Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

go to newer or older post, or back to index or month or day