-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Ensure til::u8u16 still works if the string consists of just a lead byte #4685
Conversation
… single lead byte only (GH#4673) # Conflicts: # src/inc/til/u8u16convert.h # src/til/ut_til/u8u16convertTests.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this. I had to sit down with a pad and pencil to make sure I understood how sequebnceLen/stopLen worked w/ the partial masks, but I do understand it now and this seems like the correct fix. I changed the title a little bit to make it fit in a single git commit title. 😄
Love it. Thanks! |
@msftbot merge this in 1 minute |
Hello @DHowett-MSFT! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
Hello @DHowett-MSFT! Because this pull request has the Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 51 seconds. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Once again, thanks for the contribution! This pull request was included in a set of conhost changes that was just |
Summary of the Pull Request
Fixes a flaw that happened if
til::u8u16
received a single lead byte.PR Checklist
til :: u8u16
may fail #4673Detailed Description of the Pull Request / Additional comments
The loop for caching partials didn't run and thus, the lead byte was
converted to U+FFFD. That's because the loop starts with
sequenceLen
initialized with 1. And if the string has a length of 1 the initial
condition is
1<1
which is evaluated tofalse
and the body of theloop was never executed.
Validation Steps Performed
printf "\xE2"; printf "\x98\xBA\n"
prints a U+263A charactercached
consists of a lead byte only