The unused case case (i.e. the case of the unused case)

by Michael S. Kaplan, published on 2011/10/05 07:01 -04:00, original URI:

So the thing about Digit Substitution is that it is generally an all or nothing feature.

You either have some special digits and you make the change to support them, or you have no special digits and you choose to not support them.

Oh yeah, and sometimes you occasionally have no special digits yet you change to them anyway.

That third case is kind of a bug, previously described in A difference that makes no difference makes a blog.

Ok, so you have these two settings:


Native equivalents of ASCII 0 through 9. The maximum number of characters allowed for this string is eleven, including a terminating null character. For example, Arabic uses "٠١٢٣٤٥ ٦٧٨٩". See also LOCALE_IDIGITSUBSTITUTION.


0 Context-based substitution. Digits are displayed based on the previous text in the same output. European digits follow Latin scripts, Arabic-Indic digits follow Arabic text, and other national digits follow text written in various other scripts. When there is no preceding text, the locale and the displayed reading order determine digit substitution, as shown in the following table.
Locale     Reading order     Digits used
Arabic      Right-to-left          Arabic-Indic
Thai         Left-to-right           Thai digits
All others Any                        No substitution used
1 No substitution used. Full Unicode compatibility.
2 Native digit substitution. National shapes are displayed according to LOCALE_SNATIVEDIGITS.

 and the three options:

  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 note there, but LOCALE_IDIGITSUBSTITUTION has them turned on -- a classic no-op bug;

I assume many of my readers know enough about logic to suddenly see the case we've never gotten into before....

Interesting? I'll tell you, I think so.

If we did cover this case, where would we use it?

Would it be a bug like the third case?

Discuss amongst yourselves; tomorrow I'll jump in with my thoughts....




no comments

referenced by

2011/10/06 The unused case case (i.e. the case of the unused case), part 2

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