Search, Replace and Unicode

Richmond richmondmathewson at gmail.com
Sat Dec 29 09:14:26 CST 2012


On 12/29/2012 04:35 PM, Richmond wrote:
> '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 . . .

<snip>

Richmond has a short memory; searching on the internet he turned up a 
message HE posted about 2 years ago,
which contained this:

on mouseUp
     set the useUnicode to true
     if the unicodeText of fld "FIRST" contains (numToChar(57888) &
numToChar(57999)) then
        get the unicodeText of fld "FIRST"
        replace (numToChar(57888) & numToChar(57999)) with
(numToChar(57999) & numToChar(57888)) in it
        set the unicodeText of fld "FIRST" to it
     end if
end mouseUp

which works completely.

So Richmond is a bit of a 'twat', but a happy one at least.

Richmond.



More information about the use-livecode mailing list