Closed sterlingwes closed 12 years ago
Looks like it does have to do with string length. The documentation at: https://developer.blackberry.com/html5/apis/blackberry.utils.html#.stringToBlob makes reference to acceptable string lengths but it's vague for Base64. Perhaps someone who understands the native blob format can enlighten us as to why that is?
My solution is to split the file up in chunks.
Hoping someone can help me get more detail on this error. The error referenced above is produced in my Web Inspector console when calling
blackberry.utils.stringToBlob()
. I'm testing on my Blackberry Bold 9900 with OS 7.I'm calling
blackberry.utils.stringToBlob()
with a JSON string returned byJSON.stringify
. I initially used the default encoding, but have also triedUTF-8
andBASE64
(after running it throughdecodeURIComponent(escape(window.atob( jsonString )))
.The issue appears to be content-related, as it runs fine with some content, and not with others, reliably. The content I'm trying to save is a JSON representation of a web page (after significant parsing and formatting, which is converted from DOM elements to string, and saves HTML in a format like:
{"title":"<h1>Title</h1>","content":"<p>Page content with <b>HTML</b> <i>tags</i>."}
.I'm wondering if there's any known length or character encoding issues that would cause this error to occur? I don't know enough about the Java environment to debug this properly... I've been doing all my debugging in the Web Inspector to date. The page I'm testing on that produces this error has a meta encoding tag specifying UTF-8.
Please help! This is exceedingly frustrating.