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: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: UrlEncode and ArrayEncode

Post by FourthWorld »

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: 1102
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Re: UrlEncode and ArrayEncode

Post by trevix »

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 15.7 xCode 26.01 LC 10.0.3 RC1 iOS 15> Android 7>
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: UrlEncode and ArrayEncode

Post by jacque »

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: 463
Joined: Wed Jun 07, 2017 5:37 am
Contact:

Re: UrlEncode and ArrayEncode

Post by bwmilby »

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.
trevix
Posts: 1102
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Re: UrlEncode and ArrayEncode

Post by trevix »

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 15.7 xCode 26.01 LC 10.0.3 RC1 iOS 15> Android 7>
Post Reply