RS and non-English system question

Hi All,

Is it a possibility that the boolean values of vbscript converted to strings are localized on non-English systems? I just got a report about an error from one of the script users, and looks like on their German system the False value when converted via CStr is saved to settings.ini file as “Falsch”, but then when the script tries to read the variable from ini file, there is an error since CBool can’t convert the Falsch to boolean False… I have not seen this before. They reported it only started happening since SR18 upgrade.

Here is a sample code to test, if anyone with non-English (German preferably) system could test. I am curious to see what the ini file created on Desktop looks like:

    Dim objShell,strPath : Set objShell = CreateObject("Wscript.Shell")
    strPath = objShell.SpecialFolders("Desktop") & "\test.ini"
    Dim a : a = False
    Dim b : b = Rhino.SaveSettings(strPath, "TestA", "BoolTest", Cstr(a))
    Rhino.Print CBool(Rhino.GetSettings(strPath, "TestA", "BoolTest"))

thank you,

–jarek

Have you checked what printing just Cstr(a) gives on a non-English system?

Don’t have access to non-English Rhino. Hoping someone could test and let me know.

Hi Jarek,

I tried this on a French machine. It printed False to the command line and the ini file looks like this:

[TestA]
BoolTest=Faux

Cstr(a) prints Faux on a French machine

hi Graham,

Thanks so much for testing. So it looks like on French machine it can handle the conversions well.

Could you please try one more thing:
Rhino.Print CBool("Faux")

Seems like on the German user system converting this value from ini file (“Falsch”) into boolean results in error… which is confusing because the same that the sample script seems to do on your end works (That’s why it prints “False” to command line, meaning reading French from .ini and converting to boolean works OK…)

thanks again

–jarek

Yes no problem - running this script

	Dim objShell,strPath : Set objShell = CreateObject("Wscript.Shell")
	strPath = objShell.SpecialFolders("Desktop") & "\test.ini"
	Dim a : a = False
	Dim b : b = Rhino.SaveSettings(strPath, "TestA", "BoolTest", Cstr(a))
	Rhino.Print CBool(Rhino.GetSettings(strPath, "TestA", "BoolTest"))
	Rhino.Print Cstr(a)
	Rhino.Print Cbool("Faux")

prints

False
Faux
False

In both Rhino 5 and Rhino 6 on Windows 10

Thank you again Graham! - all looks correct… which makes me think there could be something German-version specific. I am trying to have the user do some testing for me.