Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console] handles multi-byte characters in autocomplete#30354
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedFeb 23, 2019
Using For this PR, we could use that map: |
jls-esokia commentedFeb 23, 2019
My bad, I saw |
Uh oh!
There was an error while loading.Please reload this page.
| $question =newChoiceQuestion('Please select a character',$possibleChoices); | ||
| $question->setMaxAttempts(1); | ||
| $this->assertSame($character,$dialog->ask($this->createStreamableInputInterfaceMock($inputStream),$this->createOutputInterface(),$question)); |
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.
| $this->assertSame($character,$dialog->ask($this->createStreamableInputInterfaceMock($inputStream),$this->createOutputInterface(),$question)); | |
| $this->assertSame( | |
| $character, | |
| $dialog->ask($this->createStreamableInputInterfaceMock($inputStream),$this->createOutputInterface(),$question) | |
| ); |
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.
we usually prefer long lines so not sure about that :)
nicolas-grekas commentedFeb 23, 2019
Thank you@jls-esokia. |
…ls-esokia)This PR was merged into the 3.4 branch.Discussion----------[Console] handles multi-byte characters in autocompletefixes#29966| Q | A| ------------- | ---| Branch? | 3.4 <!-- see below -->| Bug fix? | yes| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets |#29966 <!-- #-prefixed issue number(s), if any -->| License | MIT| Doc PR | - <!-- required for new features -->I used the `mb_ord` to detect whether the amount of bytes read is valid before proceeding. I limit the number of bytes read to 4 before giving up because characters can use at most 4 bytes.The test passes with or without the fix though.Commits-------47320a6 handles multi-byte characters in autocomplete
fixes#29966
I used the
mb_ordto detect whether the amount of bytes read is valid before proceeding. I limit the number of bytes read to 4 before giving up because characters can use at most 4 bytes.The test passes with or without the fix though.