Unicode

Peter Haworth pete at lcsql.com
Tue Jan 27 16:03:06 EST 2015


Another quick question Devin.  Pre 7, you have to address the unicodeText
property of an object to do this.

]If I have a variable/custom property whose contents are unidecoded, how
can I uniencode it into another variable since it has no unicodeText
property?  Seems like I would need a hidden filed to act as an intermediary.

Maybe I just need to bite the bullet and use LC 7 for this project since it
doesn't need to address the unicodeText property.  This for making my
SQLiteAdmin program unicode capable.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>

On Tue, Jan 27, 2015 at 7:50 AM, Devin Asay <devin_asay at byu.edu> wrote:

>
> On Jan 26, 2015, at 5:35 PM, Peter Haworth <pete at lcsql.com> wrote:
>
> > Well I guess I spoke too soon :-)  When I said I had things working, I
> > meant I could successfully get data from a UTF8 database and display it
> > correctly.
> >
> > I'm now trying to get input from field controls and get it into the
> > database.  I found a lorem ipsum generator that would create text in
> > various languages to I got some Russian text from it and pasted it into
> an
> > LC field.
> >
> > In my handler, I need to put the contents of the field into a variable
> and
> > then hand it off from there to an INSERT statement. I've tried every
> > combination of unicodeText, uniencode, unidecode, or none of the above to
> > get the correct value into the variable but it either ends up as question
> > marks or something that looks nothing like the characters in the field.
> >
> > This is all with pre 7.0.  I think I'm beginning to understand why 7.0
> is a
> > lot better to use than pre 7.0 when heavy unicode handling is needed!
> >
> > But in the meantime, how should I be handling the above situation in pre
> > 7.0?
> >
>
> Pete,
>
> I’ve done this a lot pre-7. Here’s the relevant bit of code:
>
>   put unidecode(the unicodeText of line 1 of fld “russStuff","utf8") into
> tRussTxt
>
> At that point, since the text in tRussTxt is expressed in plain ASCII you
> can just INSERT it or UPDATE your database. To get it out again you reverse
> the process:
>
>   set the unicodeText of fld “russStuff” to
> uniencode(tRussFldFromDB,”utf8”)
>
> LC 7 of course simplifies this process, but you still have to
> textEncode/textDecode the text as you’re outputting/inputting it.
>
>   put textEncode(the text of fld “russStuff”,”utf8”) into tRussTxt # prep
> for DB
>
>   put textDecode(tRussFldFromDB,”utf8”) into fld “russStuff”  # display
> text from DB
>
> HTH
>
> Devin
>
>
> Devin Asay
> Office of Digital Humanities
> Brigham Young University
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list