Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of ArrayBuffer #78

Open
micahbf opened this issue Jun 15, 2022 · 0 comments
Open

Allow use of ArrayBuffer #78

micahbf opened this issue Jun 15, 2022 · 0 comments

Comments

@micahbf
Copy link

micahbf commented Jun 15, 2022

I am using jschardet in a browser context, where I have a file as an ArrayBuffer instead of the Node.js Buffer.

It could be nice to add the ArrayBuffer equivalent of this:

u.feed(buffer.toString('binary'));

Which I believe to be this:

const binaryString = String.fromCharCode(...new Uint8Array(arrayBuffer));

If this sounds right, I could file a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant