You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/07/16 12:26:44 UTC

[GitHub] [cordova-plugin-file] NateEag commented on issue #284: readAsText function causes encoding error reading large files

NateEag commented on issue #284: readAsText function causes encoding error reading large files
URL: https://github.com/apache/cordova-plugin-file/issues/284#issuecomment-511794307
 
 
   Just wanted to add that I ran into this problem in a project at my job.
   
   It's not that hard to encounter it - loading a file with more than 262,144 bytes that's primarily composed of multibyte characters (that is, non-ASCII ones, in UTF-8 encoding) should do it often.
   
   Here is a bit of interactive Python 3 that generates a UTF-8 file that should consistently break the `readAsText()` function:
   
   ```python3
   >>> longstring = 'a' * 262143 + u'‘abc'
   >>> file = open('testfile.txt', 'w')
   >>> file.write(longstring)
   >>> file.close()
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org