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

Side by Side Diff: pkg/utf/lib/utf_stream.dart

Issue 23135020: Add utf package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use similar wording as json package in README. Created 7 years, 3 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 | « pkg/utf/lib/utf8.dart ('k') | pkg/utf/pubspec.yaml » ('j') | no next file with comments »
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 part of dart.utf; 5 part of dart.utf;
6 6
7 abstract class _StringDecoder 7 abstract class _StringDecoder
8 extends StreamEventTransformer<List<int>, String> { 8 extends StreamEventTransformer<List<int>, String> {
9 List<int> _carry; 9 List<int> _carry;
10 List<int> _buffer; 10 List<int> _buffer;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 for (int i = additionalBytes; i > 0; i--) { 190 for (int i = additionalBytes; i > 0; i--) {
191 // 10xxxxxx (xxxxxx is next 6 bits from the top). 191 // 10xxxxxx (xxxxxx is next 6 bits from the top).
192 bytes.add(((charCode >> (6 * (i - 1))) & 0x3F) | 0x80); 192 bytes.add(((charCode >> (6 * (i - 1))) & 0x3F) | 0x80);
193 } 193 }
194 pos += additionalBytes + 1; 194 pos += additionalBytes + 1;
195 } 195 }
196 return bytes; 196 return bytes;
197 } 197 }
198 } 198 }
OLDNEW
« no previous file with comments | « pkg/utf/lib/utf8.dart ('k') | pkg/utf/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698