8000 [Console] Fixes question input encoding on Windows · symfony/symfony@4288df4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4288df4

Browse files
committed
[Console] Fixes question input encoding on Windows
1 parent 91f30e0 commit 4288df4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Console/Helper/QuestionHelper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ private function doAsk(OutputInterface $output, Question $question)
158158
$inputStream = $this->inputStream ?: STDIN;
159159
$autocomplete = $question->getAutocompleterValues();
160160

161+
if (\function_exists('sapi_windows_cp_set')) {
162+
// Codepage used by cmd.exe on Windows to allow special characters (éàüñ).
163+
sapi_windows_cp_set(1252);
164+
}
165+
161166
if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) {
162167
$ret = false;
163168
if ($question->isHidden()) {

0 commit comments

Comments
 (0)
0