MacToIso

Trevor DeVore lists at mangomultimedia.com
Tue Dec 22 11:05:53 EST 2009


On Dec 22, 2009, at 10:49 AM, JosepM wrote:

> This morning I tryed to use the unicode but all was errors in the data
> store and retrieved.
> In the datagrid how use the unicode? What is better, convert the array
> before to assing to the datagrid or use the unicode function in the
> "FillInData"?

Personally I do the conversion in FillInData. If you are creating the  
array that you are assigning to the Data Grid by hand then you can  
convert at that point as well. I am usually fetching data from the  
database using SQL Yoga though.

What If I Need to Work With htmlText, rtfText or unicodeText?: <http://lessons.runrev.com/manuals/datagrid/lessons/7328 
 >

See the getprop/setprop handlers below. Using the handlers you can  
have code in FillInData that looks like this:

on FillInData pData
     set the uUTF8Text of field "Name" of me to pData
end FillInData

> Also I haven't clear when encode or decode de unicode.

You will need to convert when setting or getting the text of a field.  
I use the attached set/getProps for working with UTF8 text.

-- 
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com

======================
CODE
======================

setprop uUTF8Text pText
     set the unicodetext of the target to uniencode(pText, "UTF8")
end uUTF8Text


getprop uUTF8Text
     return _UTF16ToUTF8(the unicodetext of the target)
end uUTF8Text



More information about the use-livecode mailing list