A funny thing happened while testing today.
Well. It really wasn’t that funny.
I was testing a new Blackberry app to run solely over BIS and / or solely over BES.
And all hell started breaking loose.
JSON wouldn’t parse. Calls broke. Dogs and cats lied down next to each other.
After a little digging, I discovered that when an app makes calls over BIS or BES, there’s a good chance the data you get back will be a mixed stream of UTF-16 and UTF-8 data.
Not just a good chance. In my case, it ALWAYS returned mixed data.
Talk about your basic cluster smuck.
The fix turned out to be simple enough. I just had to set x-rim-transcode-content in my HTTP headers to none and voila! Problem solved. Nothing but good ol’ pure UTF-8.
I can’t imagine how many people out there are having this problem. But I hope this little “heads up” can save someone a little grief.