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

Unified Diff: pkg/http/lib/src/multipart_file.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/http/lib/src/byte_stream.dart ('k') | pkg/http/lib/src/request.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/multipart_file.dart
diff --git a/pkg/http/lib/src/multipart_file.dart b/pkg/http/lib/src/multipart_file.dart
index 29ef589c024c016e9f40771c3c081c67829dd2c6..19c03bf12ce2158ae40d2a8d7be2ac40dbf6edf2 100644
--- a/pkg/http/lib/src/multipart_file.dart
+++ b/pkg/http/lib/src/multipart_file.dart
@@ -5,6 +5,7 @@
library multipart_file;
import 'dart:async';
+import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as path;
@@ -70,14 +71,14 @@ class MultipartFile {
contentType = contentType == null ? new ContentType("text", "plain")
: contentType;
var charset = contentType.charset;
- var encoding = encodingForCharset(contentType.charset, Encoding.UTF_8);
+ var encoding = encodingForCharset(contentType.charset, UTF8);
// Make a new contentType with ensured charset.
contentType = new ContentType(contentType.primaryType,
contentType.subType,
charset: encoding.name,
parameters: contentType.parameters);
- return new MultipartFile.fromBytes(field, encodeString(value, encoding),
+ return new MultipartFile.fromBytes(field, encoding.encode(value),
filename: filename,
contentType: contentType);
}
« no previous file with comments | « pkg/http/lib/src/byte_stream.dart ('k') | pkg/http/lib/src/request.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698