Is it on the list?

by Michael S. Kaplan, published on 2006/06/21 17:08 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/06/21/641988.aspx


When you look at Win32 API functions like by GetLocaleInfo/SetLocaleInfo, you will notice that only have a setting for LOCALE_SLONGDATE and not for the big list of suggested possible long date values that shows up in Regional and Language Options (RLO).

To get the list, you have to call EnumDateFormats or one of its cousins (EnumDateFormatsEx or EnumDateFormatsExEx). That is in fact what Regional and Language Options does.

(And yes, I know some of you hate those ExEx names, but things are what they are and we all have to move on now!)

Obviously anything that is in the specific field is, at least to start with, something that ought to be somewhere on the big list of possible formats.

Which is not to say that there has not been the occasional bug alomg the lines of it not being on the list (not a problem by default since the big list in RLO is built by adding the current format if it is not already in the list, but an obvious problem if you change the  format since then the old format will not shown at all!).

(The same is true for short date formats, time formats, and calendars, in case you were wondering!)

The interesting part here is that starting in Vista, the independent fields (e.g. LOCALE_SLONGDATE, LOCALE_SSHORTDATE, etc.) are no longer independently stored. Instead, they are the first item in the big list.

Which is almost always just fine (and neatly avoids the sort of bug I mentioned before), but there is one change in behavior that you may have already noticed either from the buildup above or just by being a frequent RLO user....

The change is that if the default item used to be the third on the list (for reasons of asthetics, balance, alphabetical order, or any other justification), then it will not be any more. It will always be first on the list.

Obviously a minor issue for most, and the bugs that are avoided are a lot worse than the small regression in the order of the list, but I though it might at least be worth a blog post!

 

This post brought to you by (U+09dc, a.k.a. BENGALI LETTER RRA)


no comments

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