Substitution Does Not Handle Unicode

Started by JTaylor, August 05, 2015, 09:33:10 AM

Previous topic - Next topic

JTaylor

It appears that  "%Substitution%" does not handle Unicode.  Could that be fixed soon?

Jim

td

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

I take that as a "No"?   Hadn't thought of that as a reply to my users whenever something doesn't work in my applications...maybe I'll give it a try myself  ;)

Jim

td

If by handling you mean you variables containing a Unicode string, WIL substitution handles them by converting the string to the current Windows code page.   This is the only thing it can do given that WIL scripts are always ANSI text.   So this bit of functionality isn't going to change.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Okay.  That  is all I needed to know.

Jim

DAG_P6

Quote from: td on August 05, 2015, 03:52:54 PM
If by handling you mean you variables containing a Unicode string, WIL substitution handles them by converting the string to the current Windows code page.   This is the only thing it can do given that WIL scripts are always ANSI text.   So this bit of functionality isn't going to change.

Besides that, StrReplace can do anything that substitution can do, only much more safely.
David A. Gray
You are more important than any technology.

JTaylor

I mainly use Substitution for dynamic variable creation which saves me thousands of lines of code and in the formation of SQL scripts where that are LOTS of quotes involved and adding more makes reading/debugging SQL much more difficult.  Can't see how StrReplace() can do either of those things.

Jim

DAG_P6

Quote from: JTaylor on August 07, 2015, 07:50:57 AM
I mainly use Substitution for dynamic variable creation which saves me thousands of lines of code and in the formation of SQL scripts where that are LOTS of quotes involved and adding more makes reading/debugging SQL much more difficult.  Can't see how StrReplace() can do either of those things.

Jim

When I need "dynamic" variables, I usually use an array of some kind, or a hash table of some sort (Scripting.Dictionary, and its cousins).
David A. Gray
You are more important than any technology.

JTaylor

For one of my applications I store my variables/values in a database and with a few lines of code I can retrieve/save/sync all of variables for all of the users.

Jim