Search, Replace and Unicode
Richmond
richmondmathewson at gmail.com
Sat Dec 29 09:35:51 EST 2012
'Tis very easy to do this:
on mouseUp
replace "ZaX" with "XaZ" in fld "TEKST"
end mouseUp
and "ZaXbbdsfZvfghXaasn"
will magically become:
"XaZbbdsfZvfghXaasn".
So, clutching at straws, I tried this:
on mouseUp
set the useUnicode to true
replace (numToChar(2367)) with (numToChar(105))
end mouseUp
and, kaboom-diddy-boom-diddy-boom . . .
it replaced all the instances of Unicode char 2367 with an 'i' (whacko!!!!),
BUT . . .
it also did something "awful" with the rest of the text in the fld; as
far as I can see
it 'deUnicoded' it.
tried the same sort of thing like this:
on mouseUp
set the useUnicode to true
replace (numToChar(2367)) with (numToChar(2311))
end mouseUp
and got a "right whoreson's".
So . . .
the next 'trick' is how to preserve the unicodeText as unicodeText,.
Cripes!
Richmond.
More information about the use-livecode
mailing list