-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Using For this PR, we could use that map: |
My bad, I saw |
$question = new ChoiceQuestion('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 :)
Thank you @jls-esokia. |
…ls-esokia) This PR was merged into the 3.4 branch. Discussion ---------- [Console] handles multi-byte characters in autocomplete fixes #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 <!-- see https://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_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.