Culture of Windows Script Engine

Jul 1 at 8:23 PM
Edited Jul 1 at 8:24 PM
Please add ability to change the default cultureinfo that passed to the windows script engine. An application that use a script engine can have different culture from a default culture that internally use windows script engine. That cause to problems in scripts that uses with currency/datetime formatting's
Coordinator
Jul 2 at 12:44 PM
Hi ifle,

Can you provide a sample script that would be affected by this setting?

Thanks!
Jul 2 at 1:24 PM
Edited Jul 2 at 1:40 PM
Function Money_Type_2(money)
If IsNumeric(money) Then
   Money_Type_2 = FormatCurrency(money, 2, -1, -1, -2)
End If
End Function
In my modificated version of ClearScript I pass to the script engine the CultureInfo of the Thread and all works as expected.
Coordinator
Jul 2 at 7:34 PM
I pass to the script engine the CultureInfo

You mean, via IActiveScriptSite::GetLCID()? Or is there another way?
Jul 2 at 8:08 PM
Edited Jul 3 at 5:32 AM
Yes, I mean via IActiveScriptSite::GetLCID.
Do you able to reproduce this issue?
Coordinator
Jul 2 at 9:40 PM
Yes. The only issue is that the engine seems to query this value only when the site is attached - that is, in the WindowsScriptEngine constructor. Would it be sufficient to use the current culture (or UI culture) in all cases? Or do you need to use specific cultures and/or change the culture after constructing the engine?
Jul 3 at 5:36 AM
In my case the current culture is enough
Coordinator
Jul 6 at 3:35 PM
Update posted here.