Don't encourage binary string use #496
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#496
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
as stated: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsBinaryString
It's not even supported in IE10
Javascript is bad at handling binary strings. One character is a 16-bit so it means a binary string can take up to 2x more memory since it's not in utf-8
What you should do in the readme is changing the examples to use arrayBuffer/typed arrays or just accept plain blob objects
@jimmywarting @miclill there was probably a reason for preferring readAsBinaryString, most likely performance. The demo supports both modes.
The binary string is a direct mapping of bytes (if
s
is the string,s.charCodeAt(i)
is thei
-th byte), so UTF8 conversion is not involved. The string length will be the exact byte size of the uploaded file.I agree that it would be helpful to add more examples like the readAsArrayBuffer form.
I have a 2010 tutorial that used readAsBinaryString in my bookmarks. When we added readAsArrayBuffer support, rABS was noticeably faster.