From 99ca38e988f7ffcfefd684f799de9eacd682e959 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 1 Mar 2017 13:15:48 -0800 Subject: [PATCH] make use of Dart's new capability to print Unicode on Windows (#8505) --- packages/flutter_tools/lib/src/base/logger.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/flutter_tools/lib/src/base/logger.dart b/packages/flutter_tools/lib/src/base/logger.dart index 9f4644c6d9..0dc1de8e18 100644 --- a/packages/flutter_tools/lib/src/base/logger.dart +++ b/packages/flutter_tools/lib/src/base/logger.dart @@ -116,18 +116,19 @@ class StdoutLogger extends Logger { /// A [StdoutLogger] which replaces Unicode characters that cannot be printed to /// the Windows console with alternative symbols. /// -/// This exists because of https://github.com/dart-lang/sdk/issues/28571. +/// By default, Windows uses either "Consolas" or "Lucida Console" as fonts to +/// render text in the console. Both fonts only have a limited character set. +/// Unicode characters, that are not available in either of the two default +/// fonts, should be replaced by this class with printable symbols. Otherwise, +/// they will show up as the unrepresentable character symbol '�'. class WindowsStdoutLogger extends StdoutLogger { @override void writeToStdOut(String message) { stdout.write(message .replaceAll('✗', 'X') - .replaceAll('✓', '+') - .replaceAll('•', '*') + .replaceAll('✓', '√') ); - // TODO(goderbauer): find a way to replace all other non-printable characters - // with the unrepresentable character symbol '�' } }