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

Side by Side Diff: pkg/http/lib/src/byte_stream.dart

Issue 14958005: Default to UTF-8 in the HTTP package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | pkg/http/lib/src/utils.dart » ('j') | pkg/http/lib/src/utils.dart » ('J')
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 library byte_stream; 5 library byte_stream;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:typed_data'; 9 import 'dart:typed_data';
10 10
(...skipping 17 matching lines...) Expand all
28 return buffer; 28 return buffer;
29 }).then(toUint8List); 29 }).then(toUint8List);
30 } 30 }
31 31
32 /// Collect the data of this stream in a [String], decoded according to 32 /// Collect the data of this stream in a [String], decoded according to
33 /// [encoding], which defaults to `Encoding.UTF_8`. 33 /// [encoding], which defaults to `Encoding.UTF_8`.
34 Future<String> bytesToString([Encoding encoding=Encoding.UTF_8]) => 34 Future<String> bytesToString([Encoding encoding=Encoding.UTF_8]) =>
35 toBytes().then((bytes) => decodeString(bytes, encoding)); 35 toBytes().then((bytes) => decodeString(bytes, encoding));
36 36
37 Stream<String> toStringStream([Encoding encoding=Encoding.UTF_8]) => 37 Stream<String> toStringStream([Encoding encoding=Encoding.UTF_8]) =>
38 map((bytes) => decodeString(bytes, encoding)); 38 transform(new StringDecoder(encoding));
39 } 39 }
OLDNEW
« no previous file with comments | « no previous file | pkg/http/lib/src/utils.dart » ('j') | pkg/http/lib/src/utils.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698