UrlEncode and ArrayEncode

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: UrlEncode and ArrayEncode

Post by FourthWorld » Sun Jun 10, 2018 11:48 am

Are you sure the string literal source value is derived from a means that matches the unencode sequence?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

trevix
Posts: 958
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: UrlEncode and ArrayEncode

Post by trevix » Sun Jun 10, 2018 11:57 am

Yes. Look at this:

Code: Select all

on mouseUp pMouseButton
   put "asino" into TheData["uno"]
   put base64encode(arrayEncode(TheData)) into TheData
   breakpoint
   
   put arrayDecode(base64decode(TheData)) into TheResult
   put (TheResult is an array) into msg ---YES, it's a bird
   breakpoint
   
    put arrayDecode(base64decode(TheData)) into Thedata
   put (Thedata is an array) into msg ---------------------------NOOOOO, it's Superman
   breakpoint --breakpoint will not work (bug 9552)
end mouseUp
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: UrlEncode and ArrayEncode

Post by jacque » Sun Jun 10, 2018 8:13 pm

trevix wrote:
Sun Jun 10, 2018 11:57 am
Yes. Look at this:

Code: Select all

on mouseUp pMouseButton
   put "asino" into TheData["uno"]
   put base64encode(arrayEncode(TheData)) into TheData
   breakpoint
   
   put arrayDecode(base64decode(TheData)) into TheResult
   put (TheResult is an array) into msg ---YES, it's a bird
   breakpoint
   
    put arrayDecode(base64decode(TheData)) into Thedata
   put (Thedata is an array) into msg ---------------------------NOOOOO, it's Superman
   breakpoint --breakpoint will not work (bug 9552)
end mouseUp
This works fine for me, I get "true" for both tests, and the last breakpoint also works. This is on LC 9.0 (stable) on OS X.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: UrlEncode and ArrayEncode

Post by bwmilby » Mon Jun 11, 2018 1:24 am

I just tested the code in 8.1.9 and 9.0 and always got "true" (all 3 on the first one, 2 on the second one)

Code: Select all

put "Bg0AAAABAAN1bm8GAAVhc2lubw==" into TheData -- first one
put "asino" into TheData["uno"]                 -- second one
I tested on Win10.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

trevix
Posts: 958
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: UrlEncode and ArrayEncode

Post by trevix » Tue Jun 12, 2018 8:06 am

I don't understand.
The same thing that yesterday did not work, today works for me to...
I must say that it is not the first time for me that changing var name solve some impasse.
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”