[Solved] How do I take data that might be encoded using latin-1 text format and interpret it as utf-8 [closed]


public static void main(String [] args) {
    String input = "ÁÉÍÓÚÜÑáéíóúüñ¡¿";
    //simulate ISO_8859 input
    ByteBuffer iso = StandardCharsets.ISO_8859_1.encode(input);
    CharBuffer buffer = StandardCharsets.ISO_8859_1.decode(iso);
    ByteBuffer byteBuffer = StandardCharsets.UTF_8.encode(buffer);
    System.out.println(new String(byteBuffer.array()));
}

3

solved How do I take data that might be encoded using latin-1 text format and interpret it as utf-8 [closed]