Re: File API Feedback

Nigel Tao wrote:
> I'm jumping in late to the mailing list, so I might have missed
> something said earlier...
>
> What happens if you call fileData.getAsText on a file whose contents
> are not valid unicode text (either UTF-8, UTF-16, or some other
> encoding)? For example, I presume that a significant fraction
> JPEG-encoded images aren't valid UTF-8. None of the three FileError
> codes (NOT_FOUND_ERR, NOT_READABLE_ERR, SECURITY_ERR) seem to apply.
>
>   
Implementations are expected to determine what encoding to use; in the 
above case, implementations are expected to use U+FFFD replacement 
characters, which isn't at all ideal for contents that are not valid 
unicode text.  I'm adding other asynchronous getters for FileData 
contents (getAsBinary, getAsBase64). 

Previous feedback has also shown that error codes are insufficient as 
currently specified.

-- A*

Received on Tuesday, 28 July 2009 22:14:04 UTC