Page 2 of 2

Re: UrlEncode and ArrayEncode

Posted: Sun Jun 10, 2018 11:48 am
by FourthWorld
Are you sure the string literal source value is derived from a means that matches the unencode sequence?

Re: UrlEncode and ArrayEncode

Posted: Sun Jun 10, 2018 11:57 am
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

Re: UrlEncode and ArrayEncode

Posted: Sun Jun 10, 2018 8:13 pm
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.

Re: UrlEncode and ArrayEncode

Posted: Mon Jun 11, 2018 1:24 am
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.

Re: UrlEncode and ArrayEncode

Posted: Tue Jun 12, 2018 8:06 am
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.