[Console] Fixes question input encoding on Windows
This commit is contained in:
parent
91f30e0b62
commit
4288df4f74
@ -158,6 +158,11 @@ class QuestionHelper extends Helper
|
|||||||
$inputStream = $this->inputStream ?: STDIN;
|
$inputStream = $this->inputStream ?: STDIN;
|
||||||
$autocomplete = $question->getAutocompleterValues();
|
$autocomplete = $question->getAutocompleterValues();
|
||||||
|
|
||||||
|
if (\function_exists('sapi_windows_cp_set')) {
|
||||||
|
// Codepage used by cmd.exe on Windows to allow special characters (éàüñ).
|
||||||
|
sapi_windows_cp_set(1252);
|
||||||
|
}
|
||||||
|
|
||||||
if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) {
|
if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) {
|
||||||
$ret = false;
|
$ret = false;
|
||||||
if ($question->isHidden()) {
|
if ($question->isHidden()) {
|
||||||
|
Reference in New Issue
Block a user