internal/core/adt: also use strings.ToValidUTF8 over x/text/encoding/unicode
Mimicking the change in the last commit in internal/core/convert.
Note that there is one tiny difference in test output here;
given the byte sequence 'a\x80\x95a',
x/text/encoding/unicode inserts two replacement characters for the
two invalid bytes, whereas strings.ToValidUTF8 uses one.
As long as the "rune error" sequence is inserted once, it's fine.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Idc2f78e2f9ca03c0889bda80ce402d1acab9e95a
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1229429
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>