import java.nio.charset.StandardCharsets;
public class MyClass {
public static String utf8ByteArrayToString(byte[] bytes) {
return new String(bytes, StandardCharsets.UTF_8);
}
public static void main(String args[]) {
byte[] bytes = {(byte) 0xC3, (byte) 0xA9, (byte) 0x20, (byte) 0x61, (byte) 0x62};
String str = utf8ByteArrayToString(bytes);
System.out.println(str);
}
}
/*
run:
é ab
*/