Re: Slicing files on iOS and Android

2013-01-10 Thread Becky Gibson
FYI - the W3C versions of the File API's was done back in April of 2011. Inquiring minds can see the history in my repo: https://github.com/becka11y/phonegap-iphone/blob/master/PhoneGapLib/Classes/File.m On Thu, Jan 10, 2013 at 12:12 PM, Becky Gibson wrote: > I put this in when we implemented

Re: Slicing files on iOS and Android

2013-01-10 Thread Becky Gibson
I put this in when we implemented the File APIs as it was the only way that I could get international /multi-byte characters to be supported. The implementation was way before iOS 5 so maybe the embedded browser or iOS internals have changed. -becky On Thu, Jan 10, 2013 at 11:26 AM, Braden Sh

Re: Slicing files on iOS and Android

2013-01-10 Thread Braden Shepherdson
Yes, that's one of the tests in mobile-spec, and it works fine without the escaping. On Thu, Jan 10, 2013 at 11:24 AM, Marcel Kinard wrote: > Can it pass non-ascii / multi-byte characters correctly without the > escaping? > > > On 1/10/2013 10:55 AM, Braden Shepherdson wrote: > >> Becky, do you

Re: Slicing files on iOS and Android

2013-01-10 Thread Marcel Kinard
Can it pass non-ascii / multi-byte characters correctly without the escaping? On 1/10/2013 10:55 AM, Braden Shepherdson wrote: Becky, do you know why this escaping was originally put in place? From our investigations it is unnecessary on iOS 5.0, 5.1 and 6, so we can drop it, and the iOS-specif

Re: Slicing files on iOS and Android

2013-01-10 Thread Braden Shepherdson
Becky, do you know why this escaping was originally put in place? From our investigations it is unnecessary on iOS 5.0, 5.1 and 6, so we can drop it, and the iOS-specific readAsText implementation. If no one can remember why it was there (its existence predates the porting to Apache repos, so I ca

Re: Slicing files on iOS and Android

2013-01-08 Thread Braden Shepherdson
Okay, Andrew and I investigated this a bit more this morning and found that I was getting some broken results. I can't reproduce the broken tests due to escaping, I suspect I had an old version that wasn't merging in the iOS version of FileReader. However, we continue to see that at least on 6.0

Re: Slicing files on iOS and Android

2013-01-08 Thread Braden Shepherdson
Um, what Becky describes is exactly the opposite of what I saw. The test for international characters was failing before I removed the encoding because the percent-encoded string did not match the unencoded expectation. When I removed the encoding from the native code, then all the tests including

Re: Slicing files on iOS and Android

2013-01-07 Thread Andrew Grieve
Right, what Becky said. It might be worth looking into having the iOS bridge take care of international characters directly instead of special-casing the FileReader. We should be able to escape characters using \u instead of percent escaping them. If you're interested in looking into this, let

Re: Slicing files on iOS and Android

2013-01-07 Thread Becky Gibson
The reason for encoding on iOS was to support international characters. The response from read as text is decoded in the iOS specific version of readAsText at https://github.com/apache/cordova-js/blob/master/lib/ios/plugin/ios/FileReader.js line 65. I wouldn't suspect that the all of the mob

Re: Slicing files on iOS and Android

2013-01-07 Thread Simon MacDonald
Great, that will be a very useful addition to the File API. Simon Mac Donald http://hi.im/simonmacdonald On Mon, Jan 7, 2013 at 6:30 PM, Braden Shepherdson wrote: > I've recently been implementing support for Blob.slice() for FileReader > files (sort of). With real native File and Blob objects,

Slicing files on iOS and Android

2013-01-07 Thread Braden Shepherdson
I've recently been implementing support for Blob.slice() for FileReader files (sort of). With real native File and Blob objects, they actually hold the binary data. Cordova File objects are just records passed to FileReaders. Regardless, the API for File.slice() is identical: it takes a start and o