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

Side by Side Diff: runtime/bin/process_patch.dart

Issue 23528006: Use correct output encoding in Process.runSync. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/io/process_run_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 patch class _WindowsCodePageDecoder { 5 patch class _WindowsCodePageDecoder {
6 /* patch */ static String _decodeBytes(List<int> bytes) 6 /* patch */ static String _decodeBytes(List<int> bytes)
7 native "SystemEncodingToString"; 7 native "SystemEncodingToString";
8 } 8 }
9 9
10 10
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 status._errorCode); 316 status._errorCode);
317 } 317 }
318 318
319 var result = _wait( 319 var result = _wait(
320 _stdin._sink._nativeSocket, 320 _stdin._sink._nativeSocket,
321 _stdout._stream._nativeSocket, 321 _stdout._stream._nativeSocket,
322 _stderr._stream._nativeSocket, 322 _stderr._stream._nativeSocket,
323 _exitHandler._nativeSocket); 323 _exitHandler._nativeSocket);
324 324
325 getOutput(output, encoding) { 325 getOutput(output, encoding) {
326 if (stderrEncoding == null) return output; 326 if (encoding == null) return output;
327 return encoding.decode(output); 327 return encoding.decode(output);
328 } 328 }
329 329
330 return new _ProcessResult( 330 return new _ProcessResult(
331 result[0], 331 result[0],
332 result[1], 332 result[1],
333 getOutput(result[2], stdoutEncoding), 333 getOutput(result[2], stdoutEncoding),
334 getOutput(result[3], stderrEncoding)); 334 getOutput(result[3], stderrEncoding));
335 } 335 }
336 336
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 const _ProcessResult(int this.pid, 467 const _ProcessResult(int this.pid,
468 int this.exitCode, 468 int this.exitCode,
469 this.stdout, 469 this.stdout,
470 this.stderr); 470 this.stderr);
471 471
472 final int pid; 472 final int pid;
473 final int exitCode; 473 final int exitCode;
474 final stdout; 474 final stdout;
475 final stderr; 475 final stderr;
476 } 476 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/process_run_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698