Skip to content

Commit

Permalink
Use utf8.encode() instead of longer const Utf8Encoder.convert()
Browse files Browse the repository at this point in the history
The change in [0] has propagated now everywhere, so we can use
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.

[0] dart-lang/sdk#52801
  • Loading branch information
mkustermann committed Jul 14, 2023
1 parent 427ceaf commit 15d7cd5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/web_ui/test/canvaskit/fragment_program_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void testMain() {
});

test('FragmentProgram can be created from JSON IPLR bundle', () {
final Uint8List data = const Utf8Encoder().convert(kJsonIPLR);
final Uint8List data = utf8.encode(kJsonIPLR);
final CkFragmentProgram program = CkFragmentProgram.fromBytes('test', data);

expect(program.effect, isNotNull);
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/test/engine/channel_buffers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void main() {
}

ByteData _makeByteData(String str) {
final Uint8List list = const Utf8Encoder().convert(str);
final Uint8List list = utf8.encode(str);
final ByteBuffer buffer = list.buffer;
return ByteData.view(buffer);
}
Expand Down
2 changes: 1 addition & 1 deletion testing/dart/channel_buffers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'dart:ui' as ui;
import 'package:litetest/litetest.dart';

ByteData _makeByteData(String str) {
final Uint8List list = const Utf8Encoder().convert(str);
final Uint8List list = utf8.encode(str);
final ByteBuffer buffer = list.buffer;
return ByteData.view(buffer);
}
Expand Down

0 comments on commit 15d7cd5

Please sign in to comment.