How is the decoder returned by Locale.Charset.decoder("utf-8") supposed to behave when fed a bytestream that is not valid UTF-8? It seems to return some peculiar results, instead of throwing an error (like utf8_to_string quite correctly does):
object dec = Locale.Charset.decoder("utf8"); dec->feed("\xc0\xc0")->drain();
(62) Result: "@"
utf8_to_string("\xc0\xc0");
utf8_to_string(): Expected continuation character at index 1 (got 0xc0).