Sending non-ASCII text in Http POST header
<p>I am sending a file to a server as an octet-stream, and I need to specify the filename in the header:</p>

<pre><code>String filename = "«úü¡»¿.doc"
URL url = new URL("http://www.myurl.com");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.addRequestProperty("Accept", "application/json; charset=UTF-8");
conn.addRequestProperty("Content-Type", "application/octet-stream; charset=UTF-8");
conn.addRequestProperty("Filename", filename);
// do more stuff here
</code></pre>

<p>The problem is, some of the files I need to send have filenames that contain non-ASCII characters. I have read that you cannot send non-ASCII text in an HTTP header.</p>

<p>My questions are:</p>

<ol>
<li>Can you send non-ASCII text in an HTTP header?</li>
<li>If you can, how do you do this? The code above does not work when filename contains non-ASCII text. The server responds with "Bad Request 400".</li>
<li>If you cannot, what is the typical
way to get around this limitation?</li>
</ol>
