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

Add more tests #1

Open
mathiasbynens opened this issue Jun 20, 2013 · 1 comment
Open

Add more tests #1

mathiasbynens opened this issue Jun 20, 2013 · 1 comment

Comments

@mathiasbynens
Copy link
Owner

Note that some of the things mentioned there are explicitly allowed by utf8.js. For example, utf8.js only supports Unicode code points (from 0x0 to 0x10FFFF) as per http://tools.ietf.org/html/rfc3629, so ignore the 5-byte or 6-byte sequences. Also:

There are also some non-characters. U+FFFF is one such - it cannot appear in Unicode, and hence should not appear in UTF-8 encoded data either.

Maybe, but IMHO a good UTF-8 encoder/decoder is able to handle it just fine and convert it to '\uFFFF' in JavaScript. This also seems to be a requirement as per http://encoding.spec.whatwg.org/#utf-8.

@liorean
Copy link

liorean commented Nov 10, 2017

Perhaps https://github.com/liorean/util/blob/master/utf-8/valid-boundaries.es and https://github.com/liorean/util/blob/master/utf-8/all-boundaries.es could be of use? I've found them really valuable when developing my own utf-8 libraries, though all my testing have been done in the shell and not in any testing framework.

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

2 participants