Commit 99ca38e9 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

make use of Dart's new capability to print Unicode on Windows (#8505)

parent 46f2542b
......@@ -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 '�'
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment