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

Fix the usage of "length" in the code unit prefix algorithm #290

Merged
merged 1 commit into from
Feb 12, 2020

Conversation

andreubotella
Copy link
Member

@andreubotella andreubotella commented Feb 11, 2020

This change corrects the usage of "length" as applied to strings in the code unit prefix algorithm, when in context it measures the number of code units, not code points.

Fixes #288.


Preview | Diff

@andreubotella
Copy link
Member Author

This is a replacement for pull request #289.

@annevk
Copy link
Member

annevk commented Feb 11, 2020

I don't think we had agreement on "as a JavaScript string" unfortunately. Maybe a good initial take here is to fix the reference and then file a follow-up for:

I think I prefer equating string and JavaScript string, defining scalar value string and ASCII string as subsets, and then have code unit length and code point length. One of code unit length or code point length should also be called length, but which would really depend on usage.

The follow-up should be easier once there's a global tool to look at usage of terms. Though I suppose we could start by having specific terms and using those as applicable.

@andreubotella
Copy link
Member Author

I'm not sure about having a term which is ambiguous in context distinguished only by which definition it's pointing to. But I do agree with @annevk about filing a follow-up issue, so I guess it'll do as a temporary fix.

This change corrects the usage of "length" as applied to strings in the
code unit prefix algorithm, when in context it measures the number of
code units, not code points.

Fixes whatwg#288.
@annevk annevk merged commit 646a05d into whatwg:master Feb 12, 2020
@annevk
Copy link
Member

annevk commented Feb 12, 2020

Thanks for keeping this pragmatic! Filed #291 on string improvements.

@andreubotella andreubotella deleted the length-as-js-string branch March 11, 2020 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Code unit prefix uses the wrong string length
3 participants