Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SymfonyQuestionHelper wrong output for utf8 #33928

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

Closed
proggga opened this issue Oct 9, 2019 · 2 comments
Closed

SymfonyQuestionHelper wrong output for utf8 #33928

proggga opened this issue Oct 9, 2019 · 2 comments

Comments

@proggga
Copy link
Contributor

proggga commented Oct 9, 2019

Symfony version(s) affected: 3.4

Description
Problem with stdout in class SymfonyQuestionHelper with multichoice

How to reproduce

<?php
require_once 'vendor/autoload.php';
use Symfony\Component\Console\Helper\SymfonyQuestionHelper;

use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Question\ChoiceQuestion;

$in = new ArgvInput();
$out = new ConsoleOutput();
$dialog = new SymfonyQuestionHelper();

$heroes = ['Русский' => 'russian', 'żółw' => 'bar', 'super' => 'Superman'];
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, 'super');
$question->setMultiselect(true);
$res = $dialog->ask($in, $out, $question);

And output

> php test.php
What is your favorite superhero? [Superman]:
  [Русский] russian
  [żółw       ] bar
  [super         ] Superman
 > super

But should be (Look at right brackets)

> php test.php
What is your favorite superhero? [Superman]:
  [Русский] russian
  [żółw   ] bar
  [super  ] Superman             
 > super
@proggga
Copy link
Contributor Author

proggga commented Oct 9, 2019

#33911 fix this

@proggga
Copy link
Contributor Author

proggga commented Oct 15, 2019

Anybody?

nicolas-grekas added a commit that referenced this issue Dec 17, 2019
…n choices keys and custom prompt (fancyweb)

This PR was merged into the 3.4 branch.

Discussion
----------

[Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #33928
| License       | MIT
| Doc PR        | -

Replaces / finishes #33911

Commits
-------

f175032 [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants