run() shows garbled text in Windows 10
- Dominant language
- Dart
- Stars
- 266
- Forks
- 36
- Avg merge
- 23h 25m
- Merged PRs (30d)
- 2
Description
`run()` and `runAsync()` of `run.dart` module shows garbled text for `flutter doctor` as following
```
[竏咯 Flutter (Channel
```
instead of
```
[√] Flutter (Channel...
```
I can generate this garbled text with encoding "[√]" with `utf8` and then decoding it with `systemEncoding`.
### How to reproduce
Run following in Windows which code point settings is not UTF-8 (`chcp` shows a number other than `65001`):
```dart
run('flutter', arguments: ['doctor'])
```
Note that I found that normal texts are shown with explicitly specifying `utf8` for `RunOptions.stdoutEncoding` and `RunOptions.stderrEncoding`, and `systemEncoding` is properly set to ANSI encoding of my environment.
### Workaround
We can avoid this issue with passing `RunOptions(stdoutEncoding: utf8, stderrEncoding: utf8, ...)` for `run()` and `runAsync()`.
### Environments
* grinder: 0.9.0
* Windows: Windows10 21H1 (build 19043.1237)
* Result of `chcp`: 932
Contributor guide
Assessment
This issue has not been assessed yet.