Repository navigation
Conversation
Collaborator
|
Any way you could reference the WHATWG encoding spec or the UTF-8 spec instead of having your own here? |
Member
Author
|
It already refers to the Unicode spec, I added a section reference. Unfortunately, Unicode does not provide any named definition that would be directly usable here. |
xtuc
reviewed
Dec 6, 2018
| \wedge & c = 2^{18}(b_1-\hex{F0})+2^{12}(b_2-\hex{80})+2^6(b_3-\hex{80})+(b_4-\hex{80})) \\ | ||
| \end{array} \\ | ||
| \end{array} \\ | ||
| \where b_2, b_3, b_4 < \hex{C0} \\ |
Contributor
There was a problem hiding this comment.
Shouldn't the upper boundary be based on the number of byte needed? As in the WHATWG spec.
Member
Author
There was a problem hiding this comment.
No, all continuation bytes use the full lower 6 bits for payload while the high two bits must be the tag 10 (which is what the side condition ensures). The WHATWG spec obscures this by giving an imperative algorithm with ad-hoc optimisations instead of a declarative spec.
binji
approved these changes
Dec 6, 2018
xtuc
approved these changes
Dec 6, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation bytes must not have bot 6 set.