| OLD | NEW |
| 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 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 /// The current system encoding. | 7 /// The current system encoding. |
| 8 /// |
| 9 /// This us used for converting from bytes to/from String when |
| 10 /// communicating on stdin, stdout and stderr. |
| 11 /// |
| 12 /// On Windows this will use the currently active code page for the |
| 13 /// conversion. On all other systems it will always use UTF-8. |
| 8 const SystemEncoding SYSTEM_ENCODING = const SystemEncoding(); | 14 const SystemEncoding SYSTEM_ENCODING = const SystemEncoding(); |
| 9 | 15 |
| 10 /** | 16 /** |
| 11 * The system encoding is the current code page on Windows and UTF-8 on | 17 * The system encoding is the current code page on Windows and UTF-8 on |
| 12 * Linux and Mac. | 18 * Linux and Mac. |
| 13 */ | 19 */ |
| 14 class SystemEncoding extends Encoding { | 20 class SystemEncoding extends Encoding { |
| 15 const SystemEncoding(); | 21 const SystemEncoding(); |
| 16 | 22 |
| 17 String get name => 'system'; | 23 String get name => 'system'; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 _WindowsCodePageDecoderSink(this._sink); | 127 _WindowsCodePageDecoderSink(this._sink); |
| 122 | 128 |
| 123 void close() { | 129 void close() { |
| 124 _sink.close(); | 130 _sink.close(); |
| 125 } | 131 } |
| 126 | 132 |
| 127 void add(List<int> bytes) { | 133 void add(List<int> bytes) { |
| 128 _sink.add(_WindowsCodePageDecoder._decodeBytes(bytes)); | 134 _sink.add(_WindowsCodePageDecoder._decodeBytes(bytes)); |
| 129 } | 135 } |
| 130 } | 136 } |
| OLD | NEW |