The mask used to check whether a code unit is a valid continuation was
incorrect and accepts non-continuation code points. This fixes the
issue.
Details
- Reviewers
ldionne tahonermann - Group Reviewers
Restricted Project - Commits
- rG09addf9cbe0a: [libc++][format] Fixes UTF-8 continuation.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The change looks right to me and the added tests look good. I left a couple of suggested edits with comments for you to do with as you please.
libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp | ||
---|---|---|
506–511 | I'm not sure what purpose is served by the reference to PR-121 here. The test appears to demonstrate that code unit values are preserved as escaped values which, I think, is the right behavior according to the C++ standard, but is not a match for any of the PR-121 policies. | |
libcxx/test/std/utilities/format/format.functions/unicode.pass.cpp | ||
272–274 | I eventually figured out how the mask in the comment correlated with the format string and why each was relevant, but I wouldn't expect many people to understand the intended relevance without a more descriptive comment. I suggest just removing these comments. |
Thanks for the review!
libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp | ||
---|---|---|
506–511 | That is a left over debug message for me, removed it. |
I'm not sure what purpose is served by the reference to PR-121 here. The test appears to demonstrate that code unit values are preserved as escaped values which, I think, is the right behavior according to the C++ standard, but is not a match for any of the PR-121 policies.