title: Enforce utf8 encoding in call from node to Java
body: <p>I am making a call from a node middle-tier to a Java backend and passing a string as a query param. Everything works great until non-English alphabet character are used (ex: ř,ý). When Java receives these characters it throws:</p>
  
  <pre class="lang-none prettyprint-override"><code>parse exception: org.eclipse.jetty.util.Utf8Appendable$NotUtf8Exception: Not valid UTF8!
  </code></pre>
  
  <p>This call works perfectly:</p>
  
  <pre><code>GET http://localhost:8000/server/name?name=smith
  </code></pre>
  
  <p>This call fails with the above error:</p>
  
  <pre><code>GET http://localhost:8000/server/name?name=sořovský
  </code></pre>
  
  <p>My question involves where to address this issue.
  I have found <a href="https://www.npmjs.com/package/utf8">this</a> utf8 encoder for node and was thinking about encoding my strings as utf8 before calling my Java layer in the future.
  Is that the correct approach or should I be doing something within Java?</p>
  
  <p>Note, this is what my relevant request headers look like:</p>
  
  <pre><code>{
    ...
    accept: 'application/json, text/plain, */*',
    'accept-encoding': 'gzip, deflate, sdch',
    'accept-language': 'en-US,en;q=0.8,el;q=0.6',
    ...
  }
  </code></pre>