3c3a00f331
The breaking change https://github.com/dart-lang/sdk/issues/41100 changed the UTF-8 encoder to encode unpaired surrogates as replacement characters. However, the VM contains its own, internal UTF-8 encoder, which is used for printing and for the Dart_StringToUTF8 function in the Dart API. Here, this encoder is changed to also encode unpaired surrogates as replacement characters. Fixes https://github.com/dart-lang/sdk/issues/42094 Change-Id: I9d55168f67d124dbc7987fb759696a98e7526c29 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149292 Commit-Queue: Aske Simon Christensen <askesc@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Daco Harkes <dacoharkes@google.com>