-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Fix Windows code page support #41113
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
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
Thanks for the PR. |
Well, at first I was thinking the same as the PR guide says all bug fixes should adress 4.4 branch, but here I'm fixing a method that was introduced later in 352aed3 |
Ok got it, yet this patch changes somethig that exists on 4.4: symfony/src/Symfony/Component/Console/Helper/QuestionHelper.php Lines 111 to 114 in beca689
So I guess we need an equivalent PR for 4.4. It'd be great if you could submit one. Otherwise, no worries, someone else will do (maybe me). Also, can you fix the CS issues reported by fabbot (see failing CI builds)? |
I think this is beyond my knowledge of git, but applying this fix against 4.4 will result in conflicts with 352aed3 changes... An equivalent would be to not change anything ;) Btw, I fixed CS issues but why fabbot wants me to remove these lines?
|
If Fabbot suggest to do CS fix on a unrelated line, you should just ignore it. |
It's actually related but where's the problem? Should I add description to the returned string? |
Symfony omits some annotations ( |
OK. Got it! Thanks |
Thank you @orkan. |
This PR was submitted for the 5.x branch but it was merged into the 5.2 branch instead. Discussion ---------- [Console] Fix Windows code page support My previous PR #41113 was corrected by `@nicolas`-grekas on 3bac7fe. He introduced logical changes in the code which resulted in incorrect behaviour. The basic idea was to restore the I/O codepage as soon as you get console input. And you have to do this even if `fgets()` returns **false**, because otherwise you'll leave the changed codepage for the rest of the script execution - and that's bad! Commits ------- 044b585 [Console] Fix Windows code page support
PR for 4.4 welcome btw! |
Hi @Nyholm. |
Of course. Normally, bug fixes are merged in 4.4 (or the lowest branch they exists in). Every few days we merge 4.4 -> 5.2 -> 5.x.
I dont understand. We should create a PR to 4.4 to add
Could you elaborate how they are incompatible? I dont really understand. |
Ok. Nevermind. I pushed fix #41210 for 4.4. "I am going to sit back now and..." see what will be the result code after 4.4 > 5.2 |
Resolving merge conflicts is our maintainer's duty. This one was easy ;) |
Corrects previous fixes that dealt with the mojibake problem on Windows where an OEM code page was applied to an input string and then messed with PHP.internal_encoding setting used by the script. This caused strings with different encodings to be displayed on the console output.