title: processing output encoding different from Java.io encoding?
body: <p>I have no java experience and I am just starting to experiment with Processing. </p>
  
  <p>I am trying write a script in processing which will send a 512 byte array using a http post command to a web server. This is all working well (thanks to code I dug up on the internet!) but I am having some trouble with the encodings. I am creating a character array filled with 0xFF. This prints as 512 'ÿ' characters in the output window as it should. The issue is HTTPScoop shows the post hex as a series of 0xD8 characters or the 'Ø' character. I am unsure why the console is printing one character and the output stream seems to be sending another. </p>
  
  <p>Code below:</p>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.io.OutputStreamWriter;
  import java.net.URL;
  import java.net.URLConnection;
  import java.net.URLEncoder;
  
  public static void main(String[] args) {
      try {
      // Construct data
      char[] anArray = new char[512];
      char charFillValue = 0xFF;
      Arrays.fill(anArray, charFillValue);
  
      String str = new String(anArray);
      println(str);
  
      String data = str;
      println(data);
  
      // Send data
      URL url = new URL("http://10.10.155.120:8081/set.cgi?dst=p1");
      URLConnection conn = url.openConnection();
      conn.setDoOutput(true);
      OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
      wr.write(data);
      wr.flush();
  
      // Get the response
      BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
      String line;
      while ((line = rd.readLine()) != null) {
          System.out.println(line);
      }
      wr.close();
      rd.close();
  } catch (Exception e) {
  } 
  }
  </code></pre>
  
  <p>Any help would be much appreciated!</p>