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

Unified Diff: pkg/http/lib/src/utils.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/http/lib/src/byte_stream.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/utils.dart
diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart
index d99b9be2614a4406ea11cf640b53280e0e4ed0f2..ba5c968868fc45581ff43804eee4ad12f5d4d12e 100644
--- a/pkg/http/lib/src/utils.dart
+++ b/pkg/http/lib/src/utils.dart
@@ -95,13 +95,13 @@ Encoding requiredEncodingForCharset(String charset) {
/// Converts [bytes] into a [String] according to [encoding].
String decodeString(List<int> bytes, Encoding encoding) {
// TODO(nweiz): implement this once issue 6284 is fixed.
Bob Nystrom 2013/05/16 16:11:39 How about throwing NotImplementedError if [encodin
nweiz 2013/05/16 18:32:46 I suspect most of the time when encodings get set
- return new String.fromCharCodes(bytes);
+ return decodeUtf8(bytes);
}
/// Converts [string] into a byte array according to [encoding].
List<int> encodeString(String string, Encoding encoding) {
// TODO(nweiz): implement this once issue 6284 is fixed.
Bob Nystrom 2013/05/16 16:11:39 Ditto.
- return string.codeUnits;
+ return encodeUtf8(string);
}
/// A regular expression that matches strings that are composed entirely of
« no previous file with comments | « pkg/http/lib/src/byte_stream.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698