Arrays and TextEncode/Decode

Peter Haworth pete at lcsql.com
Fri Oct 16 15:34:26 EDT 2015


Thanks for reminding me of the different arrayEncode methods in LC 7 and LC
prior to 7. Fortunately, this code will only be executed in LC7+, actually
only LC8+ so I'm OK with the array encoding.

I'm just not sure about the Unicode aspects of this though.  Normally, it
seems to be the rule that you should textEncode data when writing it out to
a file and textDecode it when reading it in from a file.  Is that still the
case when the data is arrayEncoded?  No other programs will be reading the
file, not even other LC programs.



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 Fri, Oct 16, 2015 at 12:27 PM, Monte Goulding <
monte at sweattechnologies.com> wrote:

>
> > On 17 Oct 2015, at 6:03 am, Peter Haworth <pete at lcsql.com> wrote:
> >
> > I have an array that can contain Unicode characters in either it's keys
> or
> > key values. I arrayEncode the array and write out to a file.
> >
> > Should I textEncode the keys/values before arrayEncoding the array and
> then
> > textDecode the keys/values when reading it back in and arrayDecoding it?
>
> It depends on if you are using the old arrayEncode format and need
> interoperability with old versions of LC. If it’s just 7+ then what was a
> string before arrayEncode will be a string after arrayDecode.
> _______________________________________________
> 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