double byte chars
larsbrehmer at mac.com
Mon Jun 13 11:59:28 CDT 2011
Thanks to all who replied. I finally got it right using UTF8.
Just one more question about this - does Rev unicode support not handle case sensitivity? Or is there something I need to do? My scripts won't match a word if it is capitalized, but my no- unicode apps of course do.
It's not a huge tragedy if caseSensitive = false doesn't work, but it would be nice.
While I was experimenting with workarounds I came upon something that I am very curious about. I was trying to handle this forward filter text matching by first putting the text in question into invisible fields. The actual script is matching texts stored in custom properties. I know using text is much slower but I found something crazy slow. In a script of about 600 lines, this is the relevent part;
if item 16 in Q <> empty then
repeat with g = 16 to 22 step 2
put item g in Q into fld "expTemp"
repeat with i = 1 to the num of words in fld "expTemp"
if item 1 in Q is not in eOutput then
put empty into fld "wordTemp"
select word i in fld "expTemp"
--select after text of fld "wordTemp"
delete char 1 to 2 in fld "wordTemp"
if char 1 to tNum in fld "wordTemp" = fld "search" then
put item 1 in Q & tab & item g in Q & tab & g & cr after eOutput
the inactive line --select after text of fld "wordTemp"-- causes glacial slowness when it is active. When it is inactive, the entire script runs to the end in about 220 milliseconds, but of course doesn't deliver the desired result. This is in comparison to about 35 milliseconds using your unicode suggestions, which I am very pleased with. But if that line is active, I do get the desired results, but it takes 34 SECONDS!
So out of curiousity, how can inserting the cursor in an empty field add 34 seconds to a simple script? The script is unusable of course, but for future reference, just wondering.
More information about the use-livecode