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

Side by Side Diff: pkg/third_party/html5lib/lib/src/char_encodings.dart

Issue 23493006: Remove dart:utf in third_party. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to update pubspec. 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
OLDNEW
1 /** Decodes bytes using the correct name. See [decodeBytes]. */ 1 /** Decodes bytes using the correct name. See [decodeBytes]. */
2 library char_encodings; 2 library char_encodings;
3 3
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'dart:utf'; 5 import 'package:utf/utf.dart';
6 6
7 // TODO(jmesserly): this function is conspicuously absent from dart:utf. 7 // TODO(jmesserly): this function is conspicuously absent from dart:utf.
8 /** 8 /**
9 * Returns true if the [bytes] starts with a UTF-8 byte order mark. 9 * Returns true if the [bytes] starts with a UTF-8 byte order mark.
10 * Since UTF-8 doesn't have byte order, it's somewhat of a misnomer, but it is 10 * Since UTF-8 doesn't have byte order, it's somewhat of a misnomer, but it is
11 * used in HTML to detect the UTF- 11 * used in HTML to detect the UTF-
12 */ 12 */
13 bool hasUtf8Bom(List<int> bytes, [int offset = 0, int length]) { 13 bool hasUtf8Bom(List<int> bytes, [int offset = 0, int length]) {
14 int end = length != null ? offset + length : bytes.length; 14 int end = length != null ? offset + length : bytes.length;
15 return (offset + 3) <= end && 15 return (offset + 3) <= end &&
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 case 0x9D: 203 case 0x9D:
204 if (replacementCodepoint == null) { 204 if (replacementCodepoint == null) {
205 throw new ArgumentError( 205 throw new ArgumentError(
206 "Invalid windows-1252 code point $char at $_offset"); 206 "Invalid windows-1252 code point $char at $_offset");
207 } 207 }
208 return replacementCodepoint; 208 return replacementCodepoint;
209 } 209 }
210 return char; 210 return char;
211 } 211 }
212 } 212 }
OLDNEW
« no previous file with comments | « pkg/third_party/html5lib/lib/dom_parsing.dart ('k') | pkg/third_party/html5lib/lib/src/inputstream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698