I have been working with SenseTalk for some time but I haven’t found a way to handle the scenario where the textEncode function returns a string that contains a quote (') or speechmark character (") that needs to be escaped before that variable is used to fill in a password field. The use case is that I’m connecting to a SUT and using it to login to another host, supplying a username and password.
I know the cleartext for the password, but it isn’t appropriate to embed it in my script in cleartext, so the obvious solution is to use textEncode on it once only, store the variable in the script in its encoded format, and supply it at the login prompt with a call to textDecode at the point where the login dialog needs it.
The problem I have is that the encode/decode function can generate strings with an unwanted and premature string terminator character like “'” in them - which I can’t find an easy way to escape, with the result that all the password decoded text after that character doesn’t get passed in the login credentials.
In the C programming language, any special character in a string can be escaped with a backslash - so that the string “Hello "World” will be presented as Hello "World when the string is next used. I’m looking for the same behaviour, where a backslash before a string termination character tells the interpreter to treat the next character as a literal value, not a terminator.
Does anyone have a solution for this please?