Fix old2new API conversion to use utf8.encode
Fix old2new API conversion to use utf8.encode

Pub still uses the old API to provide inputs. Source files are provided as
String, which were were incorrectly provided as codeunits. The FE expected the
binary input to be utf8 encoded.

As a separate follow up, I can update pub to provide binary data directly, or
even move it to use the new API instead so we can delete the old API soon.
Because pub-build is being replaced, I'm inclined to only do a small fix there.
Closes #32561

Bug= dartbug.com/32561
R=0f64ef784d57ffb064b634040f9eeba0d33d0be4@google.com

Change-Id: I69d9ac896d534427a918ded721ee946aa5c0fc34
Reviewed-on: https://dart-review.googlesource.com/46945
Reviewed-by: Johnni Winther <0f64ef784d57ffb064b634040f9eeba0d33d0be4@google.com>
Commit-Queue: Sigmund Cherem <beaea8fd7d2a56555046ba4f362c8a93e3938576@google.com>

dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk