Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2427)

Unified Diff: runtime/bin/process_patch.dart

Issue 22872012: Remove Encoding-enum from dart:io and add interface in dart:convert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typo. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/scheduled_test/test/scheduled_process_test.dart ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_patch.dart
diff --git a/runtime/bin/process_patch.dart b/runtime/bin/process_patch.dart
index 62489ca65205be25a8474c6815255de856390592..441e75b973cc332ff1c81938966af00c44e39570 100644
--- a/runtime/bin/process_patch.dart
+++ b/runtime/bin/process_patch.dart
@@ -38,8 +38,8 @@ patch class Process {
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- Encoding stdoutEncoding: Encoding.SYSTEM,
- Encoding stderrEncoding: Encoding.SYSTEM}) {
+ Encoding stdoutEncoding: SYSTEM_ENCODING,
+ Encoding stderrEncoding: SYSTEM_ENCODING}) {
return _runNonInteractiveProcess(executable,
arguments,
workingDirectory,
@@ -57,8 +57,8 @@ patch class Process {
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- Encoding stdoutEncoding: Encoding.SYSTEM,
- Encoding stderrEncoding: Encoding.SYSTEM}) {
+ Encoding stdoutEncoding: SYSTEM_ENCODING,
+ Encoding stderrEncoding: SYSTEM_ENCODING}) {
return _runNonInteractiveProcessSync(executable,
arguments,
workingDirectory,
@@ -324,7 +324,7 @@ class _ProcessImpl extends NativeFieldWrapperClass1 implements Process {
getOutput(output, encoding) {
if (stderrEncoding == null) return output;
- return _decodeString(output, encoding);
+ return encoding.decode(output);
}
return new _ProcessResult(
@@ -424,7 +424,7 @@ Future<ProcessResult> _runNonInteractiveProcess(String path,
.then((builder) => builder.takeBytes());
} else {
return stream
- .transform(new StringDecoder(encoding))
+ .transform(encoding.decoder)
.fold(
new StringBuffer(),
(buf, data) {
« no previous file with comments | « pkg/scheduled_test/test/scheduled_process_test.dart ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698