There is a text hosted on a server, in plain text but I try to get that data in UTF-8 format that is able to recognize "ñ" and more. I tried this

```
String readLine;
    try {
        URL url = new URL("http://miurl/data.txt");
        BufferedReader in = null;
        in = new BufferedReader(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8));

        while ((readLine = in.readLine()) != null) {
           byte ptext[] = readLine.getBytes(ISO_8859_1); 
           String value = new String(ptext, UTF_8); 
           System.out.println(value);
        }

    }
    catch (IOException ex) {
        Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
    }

```

The problem is that it reads data from url but not encoded as utf8, the letters such as "ñ" are printed strangely.