Skip to content
Snippets Groups Projects
Commit 769f0dd9 authored by Lasse R.H. Nielsen's avatar Lasse R.H. Nielsen Committed by Jacob MacDonald
Browse files

Strengthen UTF-8 decoding. (#911)

Decoding input bytes by doing `.map(utf8.decode)` assumes that input byte chunks are split at encoded code-unit boundaries.
It's safer to use `.transform(utf8.decoder)` which allows encodings to be split accross input chunks.

Also changed `.listen(f).asFuture()` to the equivalent `.forEach(f)`.
parent ba840f47
No related branches found
No related tags found
No related merge requests found
......@@ -90,8 +90,8 @@ class CompilerPool {
var buffer = new StringBuffer();
await Future.wait([
process.stdout.map(utf8.decode).listen(buffer.write).asFuture(),
process.stderr.map(utf8.decode).listen(buffer.write).asFuture(),
process.stdout.transform(utf8.decoder).forEach(buffer.write),
process.stderr.transform(utf8.decoder).forEach(buffer.write),
]);
var exitCode = await process.exitCode;
......
name: test
version: 1.3.0
version: 1.3.1-dev
author: Dart Team <misc@dartlang.org>
description: A library for writing dart unit tests.
homepage: https://github.com/dart-lang/test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment