Further Unicode ...

Mark Schonewille m.schonewille at economy-x-talk.com
Sun Dec 30 06:09:38 EST 2012


Hi Richmond,

The useUnicode property has nothing to to with transferring unicodeText from one field to another. The useUnicode property affects the charToNum and numToChar function *only* and as you have already noticed it doesn't do a very good job on higher-level unicode values. That's why I rarely use useUnicode and use binaryEncode/binaryDecode in a repeat loop most of the time.

To transfer the unicodeText, you need to do this:

on mouseUp
    put the unicodeText of fld "fCOOKED" into COOKED
    set the unicodeText of fld "fT" to COOKED
end mouseUp

This is pretty obvious, as the useUnicode property doesn't magically convert the value of COOKED from plain text to unicodeText. Changing data in a variable always takes at least another line, e.g. put uniEncode(COOKED) into COOKED, but that's taken care of by using the unicodeText property directly.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour spaces. http://www.color-converter.com

We have time for new software development projects. Contact me for a quote.




On 30 dec 2012, at 11:51, Richmond wrote:

> And now for my next trick :(
> 
> Suppose I have a fld called "fCOOKED" that contains 'numToChar(104)',
> 
> and a second fld called "fT"
> 
> and a button with this script:
> 
> on mouseUp
>   set the useUnicode to true
>     put fld "fCOOKED" into COOKED
>       set the unicodeText of fld "fT" to COOKED
> end mouseUp
> 
> why doesn't fld 'fT" end up with an 'h' in it instead
> of a large number of goobledegook numbers?
> 
> Richmond.





More information about the use-livecode mailing list