@@ -264,7 +264,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu
264
264
} elseif ("\177" === $ c ) { // Backspace Character
265
265
if (0 === $ numMatches && 0 !== $ i ) {
266
266
--$ i ;
267
- $ fullChoice = substr ($ fullChoice , 0 , -1 );
267
+ $ fullChoice = mb_substr ($ fullChoice , 0 , -1 );
268
268
// Move cursor backwards
269
269
$ output ->write ("\033[1D " );
270
270
}
@@ -278,7 +278,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu
278
278
}
279
279
280
280
// Pop the last character off the end of our string
281
- $ ret = substr ($ ret , 0 , $ i );
281
+ $ ret = mb_substr ($ ret , 0 , $ i );
282
282
} elseif ("\033" === $ c ) {
283
283
// Did we read an escape sequence?
284
284
$ c .= fread ($ inputStream , 2 );
@@ -304,7 +304,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu
304
304
$ remainingCharacters = substr ($ ret , \strlen (trim ($ this ->mostRecentlyEnteredValue ($ fullChoice ))));
305
305
$ output ->write ($ remainingCharacters );
306
306
$ fullChoice .= $ remainingCharacters ;
307
- $ i = \strlen ($ fullChoice );
307
+ $ i = mb_strlen ($ fullChoice );
308
308
}
309
309
310
310
if ("\n" === $ c ) {
0 commit comments