which is serialized into this string:
{“name”:“Cam”,“refresh”:“1”,“url”:“http://somelongurl”,“title”:“Cam”,“randomize”:“YES”}
Later, I read this back out of the registry, parse it, and allow the user to edit it and save it again. The problem is that when it’s re-saved, despite the “print” of the array LOOKING right, it now serialize’s to this:
{“name”:“String”,“refresh”:“String”,“url”:“String”,“title”:“String”,“randomize”:“String”}
Something weird is happening when data that looks just fine is re-encoded using the rdSerialize() function of librokudev. (using “JSON” option) The only thing I’m doing to the associative array before saving is calling “rdJSONBuilder(data)” (which simply calls rdSerialize(data,“JSON”) )
That’s interesting. I think I’ll actually be doing some work on the Roku in the near future, so I’ll try to take a look and see what’s happening and try to fix it.
That said, if Roku now provides a native JSON serialization method, that’s likely much better than the one implemented in librokudev, which is somewhat hacky.
If anyone has any requests, comments or suggestions for librokudev, please let me know.
“kbenson” wrote:
That’s interesting. I think I’ll actually be doing some work on the Roku in the near future, so I’ll try to take a look and see what’s happening and try to fix it.
That said, if Roku now provides a native JSON serialization method, that’s likely much better than the one implemented in librokudev, which is somewhat hacky.
If anyone has any requests, comments or suggestions for librokudev, please let me know.
Hey kbenson! Long time, no rearing of your head!
Unless I’m mistaken, I believe the librokudev JSON implementation was actually based on our collaborative Roku forum efforts several years ago (read: my appallingly bad regex, and your refinements), so I have decided to take offense to your “somewhat hacky” comment, even if it is accurate!
“TheEndless” wrote:
Hey kbenson! Long time, no rearing of your head!
Yeah, I lurk every few months with a few specific searches to see if I’ve been called out or anyone’s mentioned any of my pet projects, but generally that doesn’t happen often.
…but Roku contacted me recently re: RAF, and the numbers look interesting enough that I’m intrigued. So maybe I’ll be a bit more involved for a while.
“TheEndless” wrote:
Unless I’m mistaken, I believe the librokudev JSON implementation was actually based on our collaborative Roku forum efforts several years ago (read: my appallingly bad regex, and your refinements), so I have decided to take offense to your “somewhat hacky” comment, even if it is accurate!
Well, it works most of the time, and was generally much faster than the tokenizing parser that was posted around the same time, so I’d say we all did pretty good. But it’s still using regular expressions to parse JSON… so yeah, hacky.