Index: sdk/lib/_internal/pub/lib/src/validator/utf8_readme.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/validator/utf8_readme.dart b/sdk/lib/_internal/pub/lib/src/validator/utf8_readme.dart |
index 28cccbda67abc7ad4ffa8d0e5ceaaf1440c3a685..a0717d53e2c3719325b21785ac23ca301b6bb1c2 100644 |
--- a/sdk/lib/_internal/pub/lib/src/validator/utf8_readme.dart |
+++ b/sdk/lib/_internal/pub/lib/src/validator/utf8_readme.dart |
@@ -5,7 +5,7 @@ |
library pub.validator.utf8_readme; |
import 'dart:async'; |
-import 'dart:utf'; |
+import 'dart:convert'; |
import '../entrypoint.dart'; |
import '../io.dart'; |
@@ -22,10 +22,8 @@ class Utf8ReadmeValidator extends Validator { |
if (readme == null) return; |
var bytes = readBinaryFile(readme); |
try { |
- // The second and third arguments here are the default values. The |
- // fourth tells [decodeUtf8] to throw an ArgumentError if `bytes` isn't |
- // valid utf-8. |
- decodeUtf8(bytes, 0, null, null); |
+ // UTF8.decode doesn't allow invalid UTF-8. |
+ UTF8.decode(bytes); |
} on ArgumentError catch (_) { |
warnings.add("$readme contains invalid UTF-8.\n" |
"This will cause it to be displayed incorrectly on " |