JSON, URL-encode, and UTF-8

Charles Warwick charles at techstrategies.com.au
Thu Aug 20 22:53:35 EDT 2015


If I send that to a PHP script on one of my servers, I receive the JSON data correctly from LC7 in the PHP script.

I will just run it against LC6 and make sure it is identical.

If you want, you can post to my PHP script and then we can see how it compares between the two versions.  If it works there, it may be an issue with server you are posting to or the way that the PHP script is trying to read the data.  Probably best if you send me a direct e-mail if you want to do that.



> On 21 Aug 2015, at 12:13 pm, J. Landman Gay <jacque at hyperactivesw.com> wrote:
> 
> Here's a test. This posts just fine in LC 6.x but fails in 7.0.6 and 7.1rc1.
> 
> Make a field with this in it:
> 
>   [{"Meals":"Yes","Purpose":"Business"}]
> 
> Now put this into a button or card script:
> 
> constant kServerURL = "https://www.domain.com/results.php"  --### use a valid URL here
> 
> 
> command sendToServer
>  if the version < 7 then
>    put fld 1 into tData
>    put "json=" before tData
>  else
>    put textEncode(fld 1,"UTF8") into tData
>    put textEncode("json=",UTF8) before tData
>  end if
>  post tData to kServerURL
>  put it into tResponse
>  put the result into tErr
>  breakpoint -- so you can see it
> end sendToServer
> 
> If someone can test this against a simple echo PHP maybe it will tell us something. The real server returns empty in LC 7 and "OK" in LC 6.
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> 
> _______________________________________________
> 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