| OLD | NEW |
| 1 library inputstream; | 1 library inputstream; |
| 2 | 2 |
| 3 import 'dart:collection'; | 3 import 'dart:collection'; |
| 4 import 'dart:utf'; | 4 import 'package:utf/utf.dart'; |
| 5 import 'package:source_maps/span.dart' show SourceFile; | 5 import 'package:source_maps/span.dart' show SourceFile; |
| 6 import 'char_encodings.dart'; | 6 import 'char_encodings.dart'; |
| 7 import 'constants.dart'; | 7 import 'constants.dart'; |
| 8 import 'utils.dart'; | 8 import 'utils.dart'; |
| 9 import 'encoding_parser.dart'; | 9 import 'encoding_parser.dart'; |
| 10 | 10 |
| 11 /** Hooks to call into dart:io without directly referencing it. */ | 11 /** Hooks to call into dart:io without directly referencing it. */ |
| 12 class ConsoleSupport { | 12 class ConsoleSupport { |
| 13 List<int> bytesFromFile(source) => null; | 13 List<int> bytesFromFile(source) => null; |
| 14 } | 14 } |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 * string doesn't correspond to a valid encoding. | 301 * string doesn't correspond to a valid encoding. |
| 302 */ | 302 */ |
| 303 String codecName(String encoding) { | 303 String codecName(String encoding) { |
| 304 final asciiPunctuation = new RegExp( | 304 final asciiPunctuation = new RegExp( |
| 305 "[\u0009-\u000D\u0020-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]"); | 305 "[\u0009-\u000D\u0020-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]"); |
| 306 | 306 |
| 307 if (encoding == null) return null; | 307 if (encoding == null) return null; |
| 308 var canonicalName = encoding.replaceAll(asciiPunctuation, '').toLowerCase(); | 308 var canonicalName = encoding.replaceAll(asciiPunctuation, '').toLowerCase(); |
| 309 return encodings[canonicalName]; | 309 return encodings[canonicalName]; |
| 310 } | 310 } |
| OLD | NEW |