title: How can I fix the weird characters I receive from my websocket
body: <p>I am trying to connect a website to my java plugin (in minecraft) and let them communicate and play audio. When I try to send a connected message I receive weird characters, how can I fix this??</p>
  <pre><code>���}+��X������R�}
  </code></pre>
  <p>Websocket code:</p>
  <pre><code>      var ws = new WebSocket(&quot;ws://62.210.46.135:40050/&quot;);
  
    var url_string = window.location.href;
    var url = new URL(url_string);
    var c = url.searchParams.get(&quot;id&quot;);
  
    ws.onopen = function() {
      ws.send(&quot;UUID&quot; + c);
      document.getElementById('IDstatus').innerHTML = &quot;Waiting for response!&quot;;
      document.getElementById('IDstatus').style.color = &quot;#2f00ff&quot;;
      //document.getElementById('IDstatus').style.color = &quot;#03ad11&quot;;
    }
  
    ws.onmessage = function(e) {
      var data = e.data;
      console.log(e);
  
      if(data.includes(&quot;connected&quot;)) {
        document.getElementById('IDstatus').innerHTML = &quot;Connected!&quot;;
        document.getElementById('IDstatus').style.color = &quot;#03ad11&quot;;
      }
    }
  
    ws.onerror = function(e) {
      document.getElementById('IDstatus').innerHTML = &quot;ERROR!&quot;;
      document.getElementById('IDstatus').style.color = &quot;#ff0022&quot;;
    }
  </code></pre>
  <p>Receiver code:</p>
  <pre><code>        while(!AudioClient.getClient().isClosed()) {    
          try {
              Socket client = AudioClient.getClient();
              client.setKeepAlive(true);
              BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream()));
              String info = null;
  
              if((info = reader.readLine()) != null){
                  System.out.println(&quot;Received: &quot; + info + &quot;/n&quot;);
              }
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  </code></pre>