File API - readAsText() - newline translation

In Firefox, I noticed that when using readAsText(), the FileReader result  
shows the file's text as-is. I think it'd be cool if you could make  
readAsText return the file where newlines are always represented as just  

You could do result.replace(/\r\n|\r/g, "\n"). But, it'd be better to have  
it done automatically without producing another copy of the file's data.

You could also just handle all newline formats when you're parsing the  
file's data for example, but I think it'd still be cool if it was done  
automatically before you even touch the file's data.


Received on Saturday, 6 February 2010 13:37:47 UTC