by Michael S. Kaplan, published on 2008/09/16 10:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2008/09/16/8953564.aspx
Do French teenagers play "Truth or Dare" while growing up in France? Or is that just an American thing?
The actual question seemed innocuous enough. It wasn't:
We are noticing that on non-us XPSP3 system, when "Regional and Language Settings" (first tab) ->Set standards and formats is set to English, setting HTML input element value to true, still sets it to localized string “Vrai”.
We found that this happens because with XPSP3, there is a new folder (fr-fr on my French OS) under system32, where the vbscript.dll.mui is present which causes the localization of the string. If I remove this folder, the issue doesn’t happen. I am wondering if this was an intended change for XPSP3. However, the fact that this is inconsistent with how jscript behaves(although there is a jscript.dll.mui as well) and how this doesn’t happen with local variables, leads me to believe that this is a bug.
Boy, that takes me back.
It took me back to that software project with the bug in it -- this one.
Lest anyone doubt that this has indeed been the VB/VBA behavior for so very long, let me personally guarantee that it was.
Now I was busy being somewhere else getting ready to talk about Tamil, so luckily Paul Dempsey was around to explain what was going on, and why it is new behavior in XP SP3:
In XPSP3, all of scripting shifted to using a MUI-style model for localized resources, instead of the old satellite DLLs.
JScript and VBScript, being different languages, use different rules for the conversion between VARIANT_BOOL values and strings. JScript follows its ECMA standard (locale-invariant), and VBScript follows the in the longstanding VB tradition of a localized result. This explains the difference between jscript and vbscript.
vbscript UI strings follow the system User Interface language, not the conversion locale (Standards and Formats setting). Conversion locale will affect money, date, and time conversions to/from strings. UI locale is used for types and error messages. This explains your other observation.
By deleting the file with the localized resources, you trigger the internal fallback to English resources. On pre-XPSP3 systems, you would achieve the same effect by deleting the vbsfr.dll (the old satellite equivalent of the .mui file).
As far as I can tell, what you’re seeing is all by design.
Very interesting!
And essentially true, especially given the goal in VBScript of having it be as VB/VBA-like as possible. He did clarify the timing issue, why it was new behavior in XP SP3:
This is a side effect of fixing something different. In fact, we were enabling MUI more broadly. This specific behavior change was not intentional.
And obviously this one is an interestingly tough call -- if you think of the old behavior as a bug, then this was just a long awaited (if not entirely anticipated) bug fix. Though it confirms that the design is sound that you get what is overall the expected behavior (even if individual cases were not realized beforehand).
But it makes for an interesting twist the correctness/compatibility debate I go back and forth on here -- and a great attempt to confuse me by putting an internationalization and MUI issue in there too!
Now I am a huge fan of MUI, and of international support.
But given my history with this particular behavior and how big a fan I am of backcompat, I'm going to side with treating this one as a bug....
And I'll admit that somewhere between 15% and 20% of the reason there is personal. :-)
This blog brought to you by é (U+00e9, aka LATIN SMALL LETTER E WITH ACUTE)
Pascal Craponne on 16 Sep 2008 4:00 PM:
"Action ou vérité" (with two e acute): yes, french kids sometimes do.
:)
Michael S. Kaplan on 16 Sep 2008 11:27 PM:
You could probably tell my French came from a web site looking at each word. :-)