Skip to content

Commit 99ca38e

Browse files
authored
make use of Dart's new capability to print Unicode on Windows (flutter#8505)
1 parent 46f2542 commit 99ca38e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/flutter_tools/lib/src/base/logger.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,19 @@ class StdoutLogger extends Logger {
116116
/// A [StdoutLogger] which replaces Unicode characters that cannot be printed to
117117
/// the Windows console with alternative symbols.
118118
///
119-
/// This exists because of https://github.com/dart-lang/sdk/issues/28571.
119+
/// By default, Windows uses either "Consolas" or "Lucida Console" as fonts to
120+
/// render text in the console. Both fonts only have a limited character set.
121+
/// Unicode characters, that are not available in either of the two default
122+
/// fonts, should be replaced by this class with printable symbols. Otherwise,
123+
/// they will show up as the unrepresentable character symbol '�'.
120124
class WindowsStdoutLogger extends StdoutLogger {
121125

122126
@override
123127
void writeToStdOut(String message) {
124128
stdout.write(message
125129
.replaceAll('✗', 'X')
126-
.replaceAll('✓', '+')
127-
.replaceAll('•', '*')
130+
.replaceAll('✓', '√')
128131
);
129-
// TODO(goderbauer): find a way to replace all other non-printable characters
130-
// with the unrepresentable character symbol '�'
131132
}
132133
}
133134

0 commit comments

Comments
 (0)