8000 On windows MINGW32 git bash or cmd.exe call QuestionHelper ask method input chinese word in my command bug · Issue #31870 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

On windows MINGW32 git bash or cmd.exe call QuestionHelper ask method input chinese word in my command bug #31870

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
lcp0578 opened this issue Jun 5, 2019 · 10 comments

Comments

@lcp0578
Copy link
lcp0578 commented Jun 5, 2019

Symfony version(s) affected: 3.4.28

Description

my command code:

// table comment
        $question = new Question($questionHelper->getQuestion('Enter table comment', ''), '');
        $tableComment = $questionHelper->ask($input, $output, $question);

on windows MINGW32.

php bin/console kit:doctrine:generate:entity -vvv

Welcome to the kitlabs Doctrine2 entity generator

This command helps you generate Doctrine2 entities.

First, you need to give the entity name you want to generate.
You must use the shortcut notation like AcmeBlogBundle:Post.

The Entity shortcut name: ProcessBundle:Test
P[K7rocessBundle8r[K7ocessBundle8o[K7cessBundle8c[K7essBundle8e[K7ssBundle8s[K7sBundle8s[K7Bundle8B[K7undle8u[K7ndle8n[K7dle8d[K7le8l[K7e
8e[K78:[KT[Ke[Ks[Kt[K
Enter table comment: 测试

In QuestionHelper.php line 175:

[Symfony\Component\Console\Exception\RuntimeException]
Aborted.

Exception trace:
() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Helper\QuestionHelper.php:175
Symfony\Component\Console\Helper\QuestionHelper->doAsk() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Helper\QuestionHelper.php:80

Symfony\Component\Console\Helper\QuestionHelper->ask() at D:\phpStudy\WWW\space2019\law\vendor\kitlabs\kit-generator-bundle\Command\GenerateDoctrineEntityCommand.php:167
Kit\GeneratorBundle\Command\GenerateDoctrineEntityCommand->interact() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command
.php:240
Symfony\Component\Console\Command\Command->run() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:987
Symfony\Component\Console\Application->doRunCommand() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:86

Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:25
5
Symfony\Component\Console\Application->doRun() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:74
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:148
Symfony\Component\Console\Application->run() at D:\phpStudy\WWW\space2019\law\bin\console:27

kit:doctrine:generate:entity [--entity [ENTITY]] [--table_comment [TABLE_COMMENT]] [--fields FIELDS] [--format FORMAT] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--
version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] []

the code: \vendor\symfony\symfony\src\Symfony\Component\Console\Helper\QuestionHelper.php:175

 if (false === $ret) {
               $ret = fgets($inputStream, 4096);
               if (false === $ret) {
                   throw new RuntimeException('Aborted.');
               }
               $ret = trim($ret);
           }

but, when i use cmd.exe i can't input chinese word.
on my macbook it it ok.
my extends bundle github.com/kitlabs-cn/KitGeneratorBundle
How to reproduce

install my extends bundle
composer require kitlabs/kit-generator-bundle
run my command(on MINGW32 git bash):
php bin/console kit:doctrine:generate:entity -vvv
when "Enter table comment: " input "测试" or "你好" (chines word) it is Aborted.
but, on cmd.exe i can't input chinese word.

Possible Solution

Additional context

@lcp0578
Copy link
Author
lcp0578 commented Nov 13, 2019

@chalasr @carsonbot Is the bug fixed?

@xabbuh
Copy link
Member
xabbuh commented Nov 14, 2019

@lcp0578 There was no PR that I can see. Did you update and didn't manage to reproduce the issue anymore?

@lcp0578
Copy link
Author
lcp0578 commented Nov 14, 2019

@xabbuh hello, the reproduce,(windows 7 MINGW32 git bash)

$ php bin/console doctrine:generate:entity -vvv


  Welcome to the Doctrine2 entity generator



This command helps you generate Doctrine2 entities.

First, you need to give the entity name you want to generate.
You must use the shortcut notation like AcmeBlogBundle:Post.

The Entity shortcut name: AdminBundle:Test
A[K7dminBundle8d[K7minBundle8m[K7inBundle8i[K7nBundle8n[K7Bundle8B[K7undle8u[K7ndle8n[K7dle8d[K7le8l[K7e8e[K78:[KT[Ke[Ks[Kt[K

Determine the format to use for the mapping information.

Configuration format (yml, xml, php, or annotation) [annotation]:


Instead of starting with a blank entity, you can add some fields now.
Note that the primary key will be added automatically (named id).

Available types: array, bigint, binary, blob, boolean, date,
date_immutable, dateinterval, datetime, datetime_immutable,
datetimetz, datetimetz_immutable, decimal, float, guid, integer,
json, json_array, object, simple_array, smallint, string, text, time,
time_immutable, uuid.

New field name (press <return> to stop adding fields): 测试

In QuestionHelper.php line 175:

  [Symfony\Component\Console\Exception\RuntimeException]
  Aborted.


Exception trace:
  at D:\phpStudy\WWW\workspace\sfcms\vendor\symfony\symfony\src\Symfony\Component\Console\Helper\QuestionHelper.php:175
 Symfony\Component\Console\Helper\QuestionHelper->doAsk() at D:\phpStudy\WWW\workspace\sfcms\vendor\symfony\symfony\src\Symfony\Component\Console\Helper\QuestionHelper.php:
85
 Symfony\Component\Console\Helper\QuestionHelper->Symfony\Component\Console\Helper\{closure}() at D:\phpStudy\WWW\workspace\sfcms\vendor\symfony\symfony\src\Symfony\Compone
nt\Console\Helper\QuestionHelper.php:461
 Symfony\Component\Console\Helper\QuestionHelper->validateAttempts() at D:\phpStudy\WWW\workspace\sfcms\vendor\symfony\symfony\src\Symfony\Component\Console\Helper\Question
Helper.php:88
 Symfony\Component\Console\Helper\QuestionHelper->ask() at D:\phpStudy\WWW\workspace\sfcms\vendor\sensio\generator-bundle\Command\GenerateDoctrineEntityCommand.php:349
 Sensio\Bundle\GeneratorBundle\Command\GenerateDoctrineEntityCommand->addFields() at D:\phpStudy\WWW\workspace\sfcms\vendor\sensio\generator-bundle\Command\GenerateDoctrine
EntityCommand.php:184
 Sensio\Bundle\GeneratorBundle\Command\GenerateDoctrineEntityCommand->interact() at D:\phpStudy\WWW\workspace\sfcms\vendor\symfony\symfony\src\Symfony\Component\Console\Com
mand\Command.php:240
 Symfony\Component\Console\Command\Command->run() at D:\phpStudy\WWW\workspace\sfcms\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:1000
 Symfony\Component\Console\Application->doRunCommand() at D:\phpStudy\WWW\workspace\sfcms\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:
86
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at D:\phpStudy\WWW\workspace\sfcms\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:
255
 Symfony\Component\Console\Application->doRun() at D:\phpStudy\WWW\workspace\sfcms\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:74
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at D:\phpStudy\WWW\workspace\sfcms\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:148
 Symfony\Component\Console\Application->run() at D:\phpStudy\WWW\workspace\sfcms\bin\console:27

doctrine:generate:entity [--entity [ENTITY]] [--fields FIELDS] [--format FORMAT] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no
-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<entity>]

@lcp0578
Copy link
Author
lcp0578 commented Nov 14, 2019

@chalasr

@carsonbot
Copy link

Hey, thanks for your report!
There has not been a lot of activity here for a while. Is this bug still relevant? Have you managed to find a workaround?

@carsonbot
Copy link

Friendly reminder that this issue exists. If I don't hear anything I'll close this.

@lcp0578
Copy link
Author
lcp0578 commented Jan 3, 2021

@carsonbot No, I have not found a solution so far

@carsonbot carsonbot removed the Stalled label Jan 15, 2021
@carsonbot
Copy link

Hey, thanks for your report!
There has not been a lot of activity here for a while. Is this bug still relevant? Have you managed to find a workaround?

@carsonbot
Copy link

Just a quick reminder to make a comment on this. If I don't hear anything I'll close this.

@carsonbot
Copy link

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

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
0