Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>Does some one have a clue how to force the current browsers to append the charset to the Content-Type header?</p> </blockquote> <p>No, no browser has ever supplied a <code>charset</code> parameter with the <code>application/x-www-form-urlencoded</code> media type. What's more, the HTML spec which defines that type, does not propose a <code>charset</code> parameter, so the server can't reasonably expect to get one.</p> <p>(HTML4 <em>does</em> expect a <code>charset</code> for the subparts of a <code>multipart/form-data</code> submission, but even in that case no browser actually complies.)</p> <blockquote> <p>accept-charset="utf-8"</p> </blockquote> <p><code>accept-charset</code> is broken in IE, and shouldn't be used. It won't make a difference either way for forms in pages served as UTF-8, but in other cases it can end up with inconsistent results.</p> <p>No, with forms you just have to serve the page they're in as UTF-8, and the results should come back as UTF-8 (with no identifying marks to tell you that (except potentially for the <a href="http://dev.w3.org/html5/spec/Overview.html#url-encoded-form-data" rel="noreferrer"><code>_charset_</code> hack</a>, but Tomcat doesn't support that).</p> <p>So you have to tell the Servlet container what encoding to use for parameters if you don't want it to fall back to its default (which is usually wrong). In a limited set of circumstances you may be able to call <code>ServletRequest.setCharacterEncoding()</code> to do this, but this tends to be brittle, and doesn't work at all for parameters taken from the query string. There's not a standardised Servlet-level fix for this, sadly. For Tomcat you usually have to <a href="http://wiki.apache.org/tomcat/FAQ/CharacterEncoding" rel="noreferrer">muck about with the server.xml</a> instead of being able to fix it in the app.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload