Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Encoding independent method? #5

Open
hax opened this issue Sep 17, 2017 · 0 comments
Open

Encoding independent method? #5

hax opened this issue Sep 17, 2017 · 0 comments

Comments

@hax
Copy link

hax commented Sep 17, 2017

This may be out of the scope of this proposal.

Currently all methods at, charAt, codePointAt, charCodeAt methods and length property are utf-16 based. This limits the engine to always use UTF-16 encoding internally. But most text in Web is UTF-8 which means engines need many encoding conversions.

Maybe we can add some encoding-independant methods which can avoid such burden.

For example:

const [ch, units] = '😈'.at(0)

units can return 2 if underground encoding is UTF-16, or return 4 if underground encoding is UTF-8.

@hax hax changed the title Encoding indepe Encoding independent method? Sep 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant