Hello. I have a new blog.

I've moved this blog to the following URL Kerkness.ca. Thank you for visiting, please update your bookmarks.

Saturday, September 13, 2008

PHP json_encode() and Flex JSON.decode Gotcha

I came across a little 'gotcha' when trying to get Flex JSON.decode to properly decode a JSON string I was producing with PHP.

The one of the elements in the string contained ' &quote; ' which when being encoded by php and sent as a HTTPService response back to my Flex application was being converted back into double quotes ( " ). When Flex JSON.decode attempted to decode the string it would silently fail. No errors or anything.

In my case my JSON string was already pretty complicated with lots of variable content so it took a while to figure this out. Hopefully someone else finds this post and saves themselves some time.

No comments:

Post a Comment

Thank you for the comments.