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

Unified Diff: sdk/lib/utf/utf8.dart

Issue 11411092: Revert "Add some support for the code-point code-unit distinction." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « sdk/lib/utf/utf32.dart ('k') | sdk/lib/utf/utf_core.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/utf/utf8.dart
diff --git a/sdk/lib/utf/utf8.dart b/sdk/lib/utf/utf8.dart
index 8cc072752b79acb2d579f1460d0b75948022cbb1..48933af99f435572079a9a0a79e49397b5111d69 100644
--- a/sdk/lib/utf/utf8.dart
+++ b/sdk/lib/utf/utf8.dart
@@ -41,7 +41,7 @@ IterableUtf8Decoder decodeUtf8AsIterable(List<int> bytes, [int offset = 0,
*/
String decodeUtf8(List<int> bytes, [int offset = 0, int length,
int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
- return new String.fromCharCodes(
+ return codepointsToString(
(new Utf8Decoder(bytes, offset, length, replacementCodepoint))
.decodeRest());
}
@@ -50,7 +50,7 @@ String decodeUtf8(List<int> bytes, [int offset = 0, int length,
* Produce a sequence of UTF-8 encoded bytes from the provided string.
*/
List<int> encodeUtf8(String str) =>
- codepointsToUtf8(str.charCodes);
+ codepointsToUtf8(stringToCodepoints(str));
int _addToEncoding(int offset, int bytes, int value, List<int> buffer) {
while (bytes > 0) {
« no previous file with comments | « sdk/lib/utf/utf32.dart ('k') | sdk/lib/utf/utf_core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698